During the free fall the iphone is supposed to send acceleration values as 0 on all the three axis. So how to detect the distance covered by the iphone?
This is very simplistic, because you have to account for air friction. Air friction causes the device to reach "a" terminal velocity. Only at terminal velocity will the accellerometer indicate 0.
The formulas given here assume a free fall in a void (no friction).
In other words, it's pretty complicated to calculate the distance travelled (one problem is that terminal velocity depends on the orientation of the phone while falling).