Abu Sa'id al-Khudri reported God’s Messenger as saying, “When you see a man frequenting the mosque, testify that he has faith, for God says, ‘God’s mosques are visited only by those who believe in God and the last day.”*
* Al-Qur'an; 9:18
Tirmidhi, Ibn Majah and Darimi transmitted it.