Dāwūd said: “No one should prostrate for forgetfulness except in the five cases (1) in which the Prophet (2), may Allah bless him and grant him peace, prostrated.” End of quotation (3).
As for doubt, the Prophet did not experience it; rather, he instructed that one should proceed on the basis of certainty, disregard doubt, and prostrate before the closing salutation. Imam Ahmad said: “Doubt is dealt with in two ways: by relying on certainty or by determining what is most likely. Whoever relies on certainty disregards doubt and performs the two prostrations for forgetfulness before the closing salutation, according to the hadith of Abū Sa‘īd al-Khudrī. Whoever proceeds on what he judges most likely performs the two prostrations for forgetfulness after the closing salutation, according to the hadith of Ibn Mas‘ūd narrated by Mansūr.” End of quotation (4).
The hadith of Abū Sa‘īd reads: “If any of you doubts during his prayer and does not know how many units he has prayed—three or four—let him disregard the doubt and proceed on the basis of what he knows for certain, then perform two prostrations before giving the closing salutation.” The hadith of Ibn Mas‘ūd reads: “If any of you doubts during his prayer, let him determine what is most likely to be correct, then perform two prostrations.” Both are reported by al-Bukhārī and Muslim (5). In another wording in