It is narrated from Hazrat Sahl (may Allah be pleased with him) that I heard the Noble Prophet (peace and blessings be upon him) say: Whoever remains seated in the mosque waiting for the prayer is considered to be in prayer.
Hadith Referenceمسند احمد / مسند الأنصار رضي الله عنهم / 22812
Hadith Gradingحکم دارالسلام:صحيح لغيره، وهذا إسناد قوي