Jami' al-Tirmidhi
The Book on Salat (Prayer) — Hadith #319
وَقَدْ رُوِيَ عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ قَالَ
" مَنْ بَنَى لِلَّهِ مَسْجِدًا صَغِيرًا كَانَ أَوْ كَبِيرًا بَنَى اللَّهُ لَهُ بَيْتًا فِي الْجَنَّةِ " . حَدَّثَنَا بِذَلِكَ قُتَيْبَةُ حَدَّثَنَا نُوحُ بْنُ قَيْسٍ عَنْ عَبْدِ الرَّحْمَنِ مَوْلَى قَيْسٍ عَنْ زِيَادٍ النُّمَيْرِيِّ عَنْ أَنَسٍ عَنِ النَّبِيِّ صلى الله عليه وسلم بِهَذَا .
Mu'allaq (suspended chain): the early portion of the chain is intentionally omitted in the original text.
the Prophet said: “Whoever builds a Masjid for (the sake of) Allah, be it small or large, then Allah will build a house for him in Paradise.”