The World Federation One Stop Fiqh

Ruling 1407

If a person joins congregational prayers when the imam is in rukūʿ, then even if the dhikr of the imam has finished his congregational prayer is valid and he is regarded as being in his first rakʿah. However, if he bows down to the extent that is required for rukūʿ but the imam is no longer in rukūʿ, he can either complete his prayer on his own or break his prayer in order to join the next rakʿah.