كتاب صلاة المسافرين وقصرها
6
The Book of Prayer - Travellers
(29)
Chapter: It is recommended to offer voluntary prayers in one’s house although it is permissible to offer them in the masjid, whether that is a regular voluntary prayer or any other, except for the public ritual prayers, namely, `Id prayer, the eclipse prayer, prayers for rain and Tarawih, and prayers that can only be offered in the masjid, such as greeting the masjid, and prayers that are recommended to be offered in the masjid, namely the two rak`ah following tawaf
(29)
باب اسْتِحْبَابِ صَلاَةِ النَّافِلَةِ فِي بَيْتِهِ وَجَوَازِهَا فِي الْمَسْجِدِ ‏‏

Abu Musa reported Allah's Apostle (ﷺ) as saying:

The house in which remembrance of Allah is made and the house in which Allah is not remembered are like the living and the dead.
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ بَرَّادٍ الأَشْعَرِيُّ، وَمُحَمَّدُ بْنُ الْعَلاَءِ، قَالاَ حَدَّثَنَا أَبُو أُسَامَةَ، عَنْ بُرَيْدٍ، عَنْ أَبِي بُرْدَةَ، عَنْ أَبِي مُوسَى، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ مَثَلُ الْبَيْتِ الَّذِي يُذْكَرُ اللَّهُ فِيهِ وَالْبَيْتِ الَّذِي لاَ يُذْكَرُ اللَّهُ فِيهِ مَثَلُ الْحَىِّ وَالْمَيِّتِ ‏"‏ ‏.‏
Reference : Sahih Muslim 779
In-book reference : Book 6, Hadith 251
USC-MSA web (English) reference : Book 4, Hadith 1706
  (deprecated numbering scheme)