
According to Islamic scholars, men cannot perform salah behind a woman. Imam Nawawi (رحمة الله عليه) said:
"واتفق أصحابنا علي انه لا تجوز صلاة رجل بالغ ولا صبي خلف امرأة" (المجموع شرح المهذب 3/427)
This means that it is not valid for an adult man or a boy to pray behind a woman.
It is also stated in Minhaj al-Talibin (p.120):
"ولا تَصحُّ قُدوةُ رجلٍ ولا خُنثیٰ بِامراةٍ" — the prayer of a man or an intersex person behind a woman is not valid.