Imam Ahmad regarded it as disliked for anyone to stand with the congregation in the mosque in a manner that opposes the imam’s arrangement, because Abu Dawud narrates (677) from Abu Musa that “the Prophet ﷺ organized the rows: he placed the men in front, the boys behind them, and the women behind the boys.”
Some Hanbali scholars said that it is preferable to move back the one of lesser merit and the child; this was the view selected by the Shaykh (Ibn Taymiyyah) and was decisively affirmed by Ibn Rajab.
Others held that whoever reaches a spot first has the stronger claim to it. Al-Furuʿ states: “He has no right to move back boys who arrived before him,” and this is the Shafiʿi position, which al-Insaf also endorses. Once a boy can comprehend acts of devotion, he is, in general, like an adult.
The two hadiths—“Whoever gets to a place first has the strongest claim to it” (Bayhaqi 6/150) and “None of you should cause his brother to stand up from his seat” (Bukhari 5914; Muslim 2177)—are both general in wording. Had it been an established practice to send the boys back, the community would have continued to act upon it and it would have been transmitted in a form that left no room for dispute.
Al-Hafiz (Ibn Hajar) said: “The boys stand with the men; they line up with them and are not made to fall behind them.”