Performing Salah in congregation is a Sunnah Mu’akkadah (Confirmed Sunnah). There are a number of Hadiths that show the virtue of praying in Jama`ah. For example, ibn `Umar, may Allah be pleased with them both, reported that the Prophet, peace and blessings be upon him, said: “Prayer in congregation is superior to a Prayer performed individually by twenty-seven degrees.” (Reported by Al-Bukhari and Muslim)
Sheikh Sayyed Sabiq states, in his well-known book, Fiqh As-Sunnah:
“Whoever joins a congregation, he should perform the opening Takbir while standing and then move directly to the act that the congregation may be performing, for instance, if he finds the congregation in prostration, he should perform the opening Takbir and then join it in the prostration. However, such a person is not considered as having performed the Rak`ah unless he performs the Ruku`, even if he just bows and puts his hands on his knees, when the Imam is finishing his Ruku`.
Abu Hurayrah, may Allah be pleased with him, quoted the Messenger of Allah (peace and blessings be upon him) as saying: “If you come to the Salah and we are in Sajdah (Prostration), then make Sajdah with us but do not count it (as a Rak`ah). And, whoever catches the Ruku`, he catches the Salah.” (Reported by Abu Dawud)”