It is okay for women to form a line behind the imam when those following him are only women, but if only one woman is praying behind him, it is mustahabb for her to stand to his right side such that where she places her head for sajdah is adjacent to where his feet are when he is standing or where his knees are (when he goes to sajdah). If one man and one or more than one woman are following the imam, it is mustahabb for the man to stand to the right of the imam and the woman or women to stand behind the imam. In the case of several men or several women following the imam, it is mustahabb for them to all stand behind him, and finally, if both several and several women are following the imam together, it is mustahabb for the men to stand behind the imam and the women to be behind them.
 Tawdihul-Masa’el (annotated by Imam Khomeini), vol. 1, pg. 802.
This question does not have a detailed answer