كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(49)
Chapter: The virtue of offering the obligatory prayers in congregation, the virtue of waiting for prayer and taking many steps towards the masjid, the virtue of walking to the masjid
(49)
باب فَضْلِ صَلاَةِ الْجَمَاعَةِ وَانْتِظَارِ الصَّلاَةِ ‏‏
Sahih Muslim 649 j

Abu Huraira reported the Messenger of Allah (ﷺ) as saying:

Everyone among you is constantly in prayer so long as the prayer detains him (for this noble objective) and nothing prevents him to return to his family but the prayer.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ أَبِي الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ يَزَالُ أَحَدُكُمْ فِي صَلاَةٍ مَا دَامَتِ الصَّلاَةُ تَحْبِسُهُ لاَ يَمْنَعُهُ أَنْ يَنْقَلِبَ إِلَى أَهْلِهِ إِلاَّ الصَّلاَةُ ‏"‏ ‏.‏
Reference : Sahih Muslim 649j
In-book reference : Book 5, Hadith 343
USC-MSA web (English) reference : Book 4, Hadith 1398
  (deprecated numbering scheme)