Hadithcore
Riyad as-Salihin, 349

Abu Mas'ud Al-Ansari (May Allah be pleased with him) reported:

Messenger of Allah (ﷺ) would place his hands upon our shoulders when we would form rows for As-Salat (the prayer) and say, "Stand in straight rows and do not differ among yourselves, or else your hearts will differ due to disaccord. Let those be nearest to me who are mature and endowed with understanding (of the religion), then those who are nearest to them in these respects and then those who are nearest to them". <b>[Muslim]</b>.

وعنه قال‏:‏ كان رسول الله صلى الله عليه وسلم يمسح مناكبنا في الصلاة ويقول‏:‏ ‏

‏استووا ولا تختلفوا، فتختلف قلوبكم، ليلني منكم أولو الأحلام والنهى، ثم الذين يلونهم‏

‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Introduction, Hadith 349
Sharh · explanationclick to expand
<b>Guidance from the Hadith:</b><br> 1) It is obligatory to straighten the rows, fill the gaps, and align the shoulders and feet during the prayer.<br> 2) The imam (who leads the prayer) should be keen to check the rows and straighten them by means of words and action, in compliance with the practice of the Prophet (may Allah’s peace and blessings be upon him).<br> 3) It is encouraged to let the mature and the people of virtue and wisdom be in the nearest row to the imam.
Related hadiths6
Compare isnād across 6 related chains →