It is narrated from Sayyiduna Abu Malik al-Ash'ari (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) led the prayer, and he had the men stand nearest to him, had the boys stand behind them, and had the women stand behind them.
Hadith Referenceالمعجم الكبير للطبراني / باب الحاء / 3423