Sayyiduna Hudhayfah bin al-Yaman (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "The superiority of a house near the mosque over a house far away is like the superiority of the one who goes out to fight (in the path of Allah) over the one who stays behind."
Ahmad recorded it; its chain contains Ibn Lahi'ah, about whom there is criticism.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 1985