Al-Imām al-Bukhārī - upon whom be mercy - narrates: Ādam ibn Abī Iyās narrated to us, who said: Ibn Abī Dhi’b narrated to us, from Sa’īd al-Maqburī,
from Abū Hurayrah (may Allāh Almighty be content with him), that the Prophet ﷺ said: “A servant is considered to be in prayer as long as he remains in the mosque waiting for the prayer, so long as he does not commit ḥadath.” A non-Arab man asked: “O Abū Hurayrah, what is ḥadath?” He replied: “Passing wind with sound.”
حَدَّثَنَا آدَمُ بْنُ أَبِي إِيَاسٍ، قَالَ حَدَّثَنَا ابْنُ أَبِي ذِئْبٍ، عَنْ سَعِيدٍ الْمَقْبُرِيِّ، عَنْ أَبِي هُرَيْرَةَ
قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم " لاَ يَزَالُ الْعَبْدُ فِي صَلاَةٍ مَا كَانَ فِي الْمَسْجِدِ يَنْتَظِرُ الصَّلاَةَ، مَا لَمْ يُحْدِثْ ". فَقَالَ رَجُلٌ أَعْجَمِيٌّ مَا الْحَدَثُ يَا أَبَا هُرَيْرَةَ قَالَ الصَّوْتُ. يَعْنِي الضَّرْطَةَ.
Reference: Sahih Al Bukhari 176