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