The Messenger of Allah ﷺ said, "Prayer in congregation equals twenty-five prayers. If one prays it in an open wilderness and completes its bowing and prostration properly, it reaches fifty prayers."
حدثنا محمد بن عيسى حدثنا أبو معاوية عن هلال بن ميمون عن عطاء بن يزيد
قال رسول الله ﷺ الصلاة في جماعة تعدل خمسا وعشرين صلاة فإذا صلاها في فلاة فأتم ركوعها وسجودها بلغت خمسين صلاة
[Sahih] Ibn Majah narrated it in "The Mosques," chapter "The Merit of Praying in Congregation," no. 788, from the hadith of Abu Muawiya with this wording. Ibn Hibban graded it sahih, no. 431, as did Hakim, who said it meets the criteria of the two Shaykhs, 1/208, and Dhahabi agreed with him.