Surah At-Tawbah 9:18
إِنَّمَا يَعْمُرُ مَسَـٰجِدَ ٱللَّهِ مَنْ ءَامَنَ بِٱللَّهِ وَٱلْيَوْمِ ٱلْـَٔاخِرِ وَأَقَامَ ٱلصَّلَوٰةَ وَءَاتَى ٱلزَّكَوٰةَ وَلَمْ يَخْشَ إِلَّا ٱللَّهَ ۖ فَعَسَىٰٓ أُو۟لَـٰٓئِكَ أَن يَكُونُوا۟ مِنَ ٱلْمُهْتَدِينَ
The mosques of Allāh are only to be maintained by those who believe in Allāh and the Last Day and establish prayer and give zakāh and do not fear except Allāh, for it is expected that those will be of the [rightly] guided.
Translation: Saheeh International
Tafsir
Only he shall attend God’s places of worship who believes in God and the Last Day and observes prayer and pays the alms and fears none but God alone; it may be that those will be among the rightly guided.
Excerpt from Tafsir al-Jalalayn, commentary on 9:18, via Quran.com. The reader has the full commentary and 9 more tafsirs.