Fiqh-us-Sunnah Volume 1, Purification and Prayer, Fiqh 1.054.
Section : Staying in the mosque. It is forbidden for one who is physically unclean (because of sex or menstruation) to stay in the mosque. ‘Aishah said, “The Messenger of Allah, upon whom be peace, saw that his companions’ houses…