Positioning when a boy and a woman pray behind the Imam
Chapter on Imamate and Congregational Prayer
Al-Mughni
Book of Prayer
Primary text
If one of the followers is a boy and the prayer is voluntary, both the man and the boy stand behind the Imam, and the woman stands behind them, based on the hadith of Anas. If the prayer is obligatory, the man stands to the right, and the boy to the left, as previously stated. It is permissible for both to stand to the Imam's right. If both are placed behind him, there is a view that it is invalid because the woman cannot form a row with the man she is following, similar to her standing with men.
Supporting text
Another view suggests it is valid because it is analogous to a voluntary worshipper standing beside one praying the obligation, which is permissible.