Reference: Fataawa Arkaan al-Islaam – Page 34, Fatwa No.11
Question: Is it permissible to bear witness to someone’s eemaan (faith) just because he regularly goes to the masjid, as occurs in the hadeeth?
Response: Yes. No doubt, whoever attends the prayers in the masaajid, then his attendance in this regard is evidence as to his eemaan, since nothing but his eemaan in Allaah (Subhaanahu wa Ta’aala) caused him to leave his house and exert himself to go to the masjid.
And as for the questioner saying “as occurs in the hadeeth”, then he is referring to that which is narrated from the Prophet ﷺ:
«If you see a man regularly attending the masaajid, then bear witness to his eemaan», [Transmitted by at-Tirmidhee, No.2617]
However, this hadeeth is weak, and not authenticated from the Prophet ﷺ.