The Prophet (peace be upon him) said: The Salah offered in congregation is twenty-five times more superior (in reward) than Salah offered alone in one's home or place of business. If a person misses the first congregation and Allah helps him find another congregation in another Masjid or in the same Masjid, it is recommended to offer Salah with the congregation. As for what is reported that some of the Salaf (righteous predecessors) would return and offer Salah alone if they missed the congregation, this is Ijtihad (juristic effort to infer expert legal rulings) from them and it should not take precedence over Shari`ah (Islamic law).
It was authentically reported on the authority of
Anas (may Allah be pleased with him) as related in the Sahih (authentic) Book of Hadith of Imam
Al-Bukhari that he once came and found that people
had finished Salah. Thereupon, he gathered his companions and led them
in congregational Salah.
Anas is one of the best Companions of the Prophet (peace be upon him) and one of the best to be followed. therefore,
the basic rule is the validity of congregation. This is the basis and it is not to be abandoned except with evidence.
it is reported that the Salaf used to offer a second congregation when
they missed the first congregation and the Prophet (peace be upon him)
encouraged those who were present to offer Salah with the one who missed
the congregation, saying:
Who will do good to this (man) and offer Salah along with him?
The aim of this is to get the merits of congregational Salah. This
Hadith is clear evidence regarding the issue in question. However, if
one comes while the Imam is in the last Tashahhud, it is better for him
to join the congregation with the Imam because of the general meaning of
the following Hadith in which the Prophet (peace be upon him) said:
When you come to Salah, walk calmly and do not come hurriedly, and then pray what you catch and complete what you miss.
The statement of the Prophet (peace be upon him):
Pray what you catch
applies to the last Rak`ah (unit of Prayer), Tashahhud, and even
more. Accordingly, one should join the Imam and complete what is missed
individually. The reward of congregation is granted by catching one
Rak`ah, for the Prophet (peace be upon him) said:
Whoever attends one Rak`ah (in congregation) is considered to have attended the Salah (in congregation).
(Related by Muslim in his Sahih)