Abu Masud reported the Messenger of Allah ﷺ as saying: let those of your who are sedate and prudent be near me, then those who are next to them, then those who are next to them.
Related hadith on this topic
Explanation & Benefits
Shaykh Umar Farooq Saeedi
674. Commentary:
The Messenger of Allah (sallallahu alayhi wa sallam) instructed that the people of knowledge and virtue among the noble Companions (radi Allahu anhum) should stand close to him so that they could closely observe his prayer and also fulfill the requirements of etiquette. Thus, this is also required within the Ummah, so that these individuals can alert the imam to any mistake or forgetfulness, and if the need arises, the imam can appoint one of them as his deputy. ... From this, it is necessarily understood that people of knowledge and virtue should be present on time and take a place close to the imam, so that their being people of knowledge and virtue is practically established. If they remain behind the first row, then their being “people of knowledge and virtue” becomes questionable, as is generally observed.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 674