I entered upon the Messenger of Allah ﷺ in the house of one of his wives and asked, "Messenger of Allah, which of the two mosques is the one founded upon piety?"He took a handful of pebbles and struck the ground with them, then said, "It is this mosque of yours," meaning the mosque of Medina.
دخلت على رسول الله ﷺ في بيت بعض نسائه، فقلت: يا رسول الله أي المسجدين الذي أسس على التقوى؟ قال: فأخذ كفا من حصباء فضرب به الأرض، ثم قال: هو مسجدكم هذا لمسجد المدينة.
Muslim narrated it in Hajj (514:1398) from Muhammad bin Hatim, who said, Yahya bin Saeed narrated to us, from Humayd Khirat, who said, I heard Abu Salama bin Abdul-Rahman say, Abdul-Rahman bin Abu Saeed Khudri passed by me, so I said to him, "What did you hear your father say regarding the masjid that was founded on piety?"He said, My father, meaning Abu Saeed Khudri, said, and then he mentioned it.