It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Do not prevent women from the mosques, and their houses are better for them."
Imam Ahmad (may Allah have mercy on him) also narrated it through Yazid bin Harun from al-Awwam.
And Abu Dawud (may Allah have mercy on him) narrated it through Uthman bin Abi Shaybah from Yazid bin Harun.
From this hadith we intended only the sentence: "and their houses are better for them," because the sentence "Do not prevent women from the mosques" has already been mentioned in the Sahih (al-Bukhari and Muslim).