If the worshipper enters the mosque and the imam is praying, he should join him no matter what position he is in, whether he is standing, bowing, prostrating or between prostrations. That is because of the report narrated by Abu Hurayrah (may Allaah be pleased with him) who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “If you come to prayer and we are prostrating, then prostrate, but do not regard it as anything. Whoever catches up with a rak’ah has caught up with the prayer.” Narrate by Abu Dawood, 893; classed as hasan by al-Albaani in Saheeh Abi Dawood.
It was narrated that Abu Qataadah (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “When you come to prayer you must be dignified. Whatever you catch up with, pray, and whatever you miss, complete it.” Narrated by al-Bukhaari, 635.
Al-Haafiz Ibn Hajar (may Allaah be pleased with him) said in Fath al-Baari, 1/118: This is quoted as evidence that it is mustahabb to join the imam in whatever position he is found.” End quote.
It was narrated that Mu’aadh ibn Jabal said: The Prophet (peace and blessings of Allaah be upon him) said: “When one of you comes to the prayer and the imam is in any position, let him do what the imam is doing.” Narrated by al-Tirmidhi, 591; classed as saheeh by al-Albaani in Saheeh al-Tirmidhi.
This is the Sunnah with regard to the one who enters the mosque and finds the imam praying, based on the evidence in the texts.
Ibn Hazm (may Allaah have mercy on him) narrated that there was scholarly consensus on this point. He said in Maraatib al-Ijmaa’ (p. 25): They said: If a person comes and the imam has already done some of the prayer, a little or a lot, and there is nothing left but the salaam, he should join him and do the same as he finds him doing, unless he has decided to catch up with the congregation in another mosque. End quote.
Ibn Qudaamah said in al-Mughni (2/184):
It is mustahabb for the one who catches up with the imam in any position to follow him in that, even if it will not count as anything for him… Then he quoted some of the ahaadeeth that we have quoted above… Then he said: This is what is to be done according to the scholars, who said: If a man comes and the imam is prostrating, let him prostrate, but that rak’ah will not count for him. Some of them said: perhaps by the time he raises his head, he will have been forgiven. End quote.
There are some people who, if they enter the mosque and find that the imam is prostrating or is between the two prostrations, they do not join him until he stands up for the second rak’ah or until they know that he is reciting the tashahhud, then they sit with him. Such a person has deprived himself of the benefit of prostration, as well as going against what is indicated by the evidence quoted above.
It says in Tuhfat al-Ahwadhi (2/199): Let him do what the imam is doing, i.e., let him join the imam whether he is standing, bowing or whatever. He should not wait for the imam to stand up as the common folk do. End quote.
See: Ahkaam Hudoor al-Masaajid, p. 138-139, by Shaykh ‘Abd-Allaah ibn Saalih al-Fawzaan.
The scholars of the Standing Committee for Issuing Fatwas were asked about a man who enters the mosque when the imam is in the final rak’ah. Should he join them or wait until they have finished?
What is prescribed in your situation is to join them. Whatever you catch up with, pray with them, and whatever you miss, make it up. If you join them after they stand up from bowing in the last rak’ah, then join them and make up the entire prayer after the imam says the salaam. …. Then they quoted as evidence the ahaadeeth that we have quoted above. End quote.
‘Abd al-‘Azeez ibn ‘Abd-Allaah ibn Baaz, ‘Abd al-Razzaaq ‘Afeefi, ‘Abd-Allaah ibn Qa’ood, ‘Abd-Allaah ibn Ghadyaan.
The scholars of the Standing Committee were also asked: What is better if a man enters the mosque and the imam is reciting the final tashahhud – should he join him in the tashahhud or is it better to wait for some other people to come so that they can pray together?
It is better for him to join the imam, because of the general meaning of the hadeeth: “Whatever you catch up with, pray, and whatever you miss, make it up.” End quote.
‘Abd al-‘Azeez ibn ‘Abd-Allaah ibn Baaz, ‘Abd al-Razzaaq ‘Afeefi, ‘Abd-Allaah ibn Qa’ood.
Fataawa al-Lajnah al-Daa’imah, 7/312-323.