It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them) that the Messenger of Allah (peace and blessings be upon him) said: "The prayer of a man with the congregation is twenty-seven times greater than his prayer alone."
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1311
Hadith Takhrijاس روایت کی سند صحیح اور حدیث متفق علیہ ہے۔ دیکھئے: [بخاري 645] ، [مسلم 650] ، [أبويعلی 5752] ، [ابن حبان 2052]
Brief Explanation
(Explanation of Ahadith 1309 to 1311)
When a person performs prayer (salah) alone, he receives the reward of only one prayer, and if he performs prayer in congregation (jama‘ah), he receives the reward of 25 or 27 prayers.
In the narration of the Sahihayn, it is stated that prayer in congregation is even superior to 27 prayers.
From this, the virtue of prayer in congregation is understood, and there is no contradiction between these two narrations because it is possible that at one time the Prophet (sallallahu alayhi wa sallam) said 25 and at another time said 27.