The World Federation One Stop Fiqh

Ruling 1349

If a person starts performing a four rakʿah prayer and during the prayer he remembers that he is a traveller, or he becomes aware that his journey is of eight farsakhs, in the event that he has not gone into rukūʿ of the third rakʿah, he must complete the prayer as a two rakʿah prayer. However, if he has completed the third rakʿah, his prayer is invalid; and if he has gone into rukūʿ of the third rakʿah, then based on obligatory precaution, his prayer is also invalid. Furthermore, in case there is enough time to perform even one rakʿah, he must perform the prayer again in qaṣr form; and if there is no time, he must make it up in qaṣr form.