The World Federation One Stop Fiqh

Ruling 1430

If while a person is performing a three rakʿah or four rakʿah prayer a congregational prayer commences, in the event that he has not gone into the rukūʿ of the third rakʿah and he is not confident that if he completes the prayer he will be able to join the congregational prayer, it is recommended that he completes the prayer as a two rakʿah prayer with the intention of a recommended prayer and joins the congregational prayer.