All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The position of the Imam should be in the middle front of the people led in prayer behind him if they are three or more. Such is also the case if the people led in prayer are two according to the most preponderant opinion. However, if there is only one praying person with the Imam, then he should stand at his right side. Jaber said “Once the Prophet stood to pray and I stood on his left, but he took my hand and guided me till I became on his right, after that Jabbar Ibn Sakhr came and stood on the left side of the Prophet but the Prophet pushed both of us till we stood behind him.” [Muslim and Abu Daawood]
In case the two people praying behind the Imam are of different sexes, then the male, whether he is an old man or a child, stands on the right side of the Imam whereas the female stands behind them both. Moreover, Anas narrated that the Prophet led him and his mother or his maternal aunt in prayer, and he said that the Prophet stood him on his right side and made the woman to stand behind him.” [Ahmad, Muslim and Abu Daawood]
If a woman leads women in prayer, she stands in the middle of them and in the same row as them.
Allah knows best.