Sunan an-Nasa'i, Book 8, Hadith 47 (In-Book) ⓘ
Sahl As-Sa'idi, may Allah be pleased with him, said: "I heard the Messenger of Allah say: 'Whoever is in the Masjid waiting for the prayer, he is in a state of prayer.'"
أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا بَكْرُ بْنُ مُضَرَ، عَنْ عَيَّاشِ بْنِ عُقْبَةَ، أَنَّ يَحْيَى بْنَ مَيْمُونٍ، حَدَّثَهُ قَالَ سَمِعْتُ سَهْلاً السَّاعِدِيَّ، - رضى الله عنه - يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ " مَنْ كَانَ فِي الْمَسْجِدِ يَنْتَظِرُ الصَّلاَةَ فَهُوَ فى الصَّلاَةِ " .
also referenced under: Hadith 734 (Reference) & Volume 1, Book 8, Hadith 735 (DarusSalam)