Hadithcore
Riyad as-Salihin, 350

'Abdullah bin Mas'ud (May Allah be pleased with him) reported:

Messenger of Allah (ﷺ) said, "Let those be nearest to me in Salat (prayer) who are mature and possess (religious) knowledge, then those who are nearest to them in these respects". He repeated this three times and then added, "Beware of indulging in the loose talks of the markets (when you are in the mosque)". <b>[Muslim]</b>.

وعن عبد الله بن مسعود رضي الله عنه قال‏:‏ قال رسول الله صلى الله عليه وسلم‏:‏ ‏"‏ليلني منكم أولو الأحلام والنهى، ثم الذين يلونهم‏"‏ ثلاثًا ‏"‏وإياكم وهيشات الأسوق‏"‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Introduction, Hadith 350
Sharh · explanationclick to expand
<b>Guidance from the Hadith:</b><br> 1) Mosques have their preserved right; it is impermissible for the worshipers to quarrel or raise their voices inside mosques since this eliminates the required Khushū‘ (humble sumission to Allah).<br> 2) It is urged to let the wise and mature people stand right behind the imam then those next to them in that respect.<br> Benefit (1):<br> Some people understand from the Hadith that it is forbidden for boys to stand right behind the imam, which is incorrect. There is a difference between saying, ‘none but the mature should be near to me,’ and the statement of the Prophet (may Allah’s peace and blessings be upon him): ‘Let those who are mature be near to me.’ The second statement urges those who are mature and wise to step forward and be nearest to the imam, and this is the one reported in the Hadith, whereas the first means that he forbids those who are not adults or wise to be nearest to the imam. Accordingly, it is impermissible to prevent boys from standing in the first rows unless they cause trouble, because the Prophet (may Allah’s peace and blessings be upon him) did not forbid boys from standing right behind the imam, but rather, he urged the mature men to stand near to the imam. So contemplate the difference in meaning.<br> Benefit (2)<br> Those who ban boys from joining the first rows have fallen into several evils, some of which are:<br> 1) They prevent them from enjoying their rights, since boys, even little ones, have rights.<br> 2) They make little boys dislike mosques, which may lead to their aversion to mosques and hating those who dismiss them.<br> 3) If boys are dismissed from the first rows, they will be placed in the last rows where they will have the chance to engage in play and cause disturbance.<br> <br> <br> <br> <b>Words in the Hadith:</b><br> Tumult of the markets: what occurs therein of crowding, arguing, disputing, and raised voices.