In Sahih al-Bukhari under the chapter, One woman can form a row, it is written:
Narrated Anas bin Malik: One night an orphan and I offered the prayers behind the
(Sahih al-Bukhari, Book 10, Hadith 121).Prophet sas in my house and my mother (Umme Sulaim) was standing behind us (by herself forming a row)
The Promised Messiah as was asked whether a woman should observe prayer next to a man or behind him. The Promised Messiah as said that she should stand behind. For exceptional reasons, a wife can stand next to her husband in prayer. Hadrat Amman Jan ra said that the Promised Messiah as said to her:
Since I sometimes have dizzy spells while standing, therefore observe prayer standing next to me.
(Fiqhul-Masih, p. 110).