Riyad as-SalihinChapter 8Hadith 407
Full Sharh — Riyad as-Salihin 407
وعن أبي مسعود رضي الله عنه قال: كان رسول الله صلى الله عليه وسلم يمسح مناكبنا في الصلاة، ويقول: "استووا ولا تختلفوا فتختلف قلوبكم، ليلني منكم أولو الأحلام والنهى، ثم الذين يلونهم ثم الذين يلونهم". ((رواه مسلم)).
English Translation
Abu Mas'ud (May Allah be pleased with him) reported:: The Messenger of Allah (ﷺ) used to gently pat our shoulders when we were standing in rows at the time of Salat and say, "Keep (the rows) straight; do not differ from each other lest your hearts should suffer from discord. Let those of you who are mature and prudent be nearer to me, and then those who are next to them.".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of Virtues
Hadith Number
407