"I heard the Messenger of Allah ﷺ say: 'Whoever is in the Masjid waiting for the prayer, he is in a state of prayer.'" (Using translation from Nasāʾī 734)
سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ «مَنْ كَانَ فِي مَسْجِدٍ يَنْتَظِرُ الصَّلَاةَ فَهُوَ فِي صَلَاةٍ»