Waiting for Prayer Counts as Prayer
Narrated Abu Huraira:
Allah’s Apostle said, “A person is considered in prayer as long as he is waiting for the prayer in the mosque as long as he does not do Hadath.” A non-Arab man asked, “O Abii Huraira! What is Hadath?” I replied, “It is the passing of wind (from the anus) (that is one of the types of Hadath).”
Translation of Sahih Bukhari, Volume 1, Book 4, Number 176

