When the CoG moves aft of the vertical plane through the line between the two aftmost supporting points of the potentially tipping rigid body is the geometrical answer.
In your formula, D would be the distance to the CoG from datum prior to applying the force F at a distance L from the center of gravity of a body with the weight W. If F is zero, D will indeed remain exactly D.
If you are really asking how you can calculate if the aircraft will tip over, the answer is that you need to calculate the CoG of the aircraft and compare it with the (hopefully) known limiting location given by the geometry of the landing gear.