Assalaamu alaykum. I was praying the Thuhr and had a doubt during one of my Rak'ahs (unit of prayer). I doubted whether it was my fourth or third Rak'ah, but I assumed that it was my fourth, and even though I was thinking of doing Sujood As-Sahw (prostration of forgetfulness), I did not do so. Is my prayer valid even if I omitted Sujood As-Sahw? (My average four Rak'ah prayer sometimes takes around eight minutes, and after having finished my prayers, I saw that about eight minutes had passed.)
All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
If you doubt whether you have prayed three Rak’ahs or four Rak’ahs, and then you predominantly think that it was four Rak’ahs, then, based on the view of some scholars, you act according to what you predominantly think, but you should make Sujood As-Sahw after concluding the prayer with the Salaam.
Ash-Sharh al-Mumti’ reads:
“The second view on the issue: If a person doubts and then he predominantly thinks that one matter is more preponderant than the other, he should act upon the more preponderant one, whether it is the most Rak’ahs or the least Rak’ahs. The evidence for this statement is the hadeeth by Ibn Mas’ood who narrated that the Prophet said about the one who doubts and he hesitated whether he prayed three or four Rak’ahs, '...he should endeavor to find out what is correct and then complete accordingly;' he should base himself on what appears to be preponderant in his view and then conclude the prayer with Salaam, and then he prostrates two prostrations for forgetfulness.'
This, along with the first hadeeth, indicates that doubt is of two kinds:
Firstly: a case when one can act according to the preponderant opinion between the two matters;
Secondly: a case when one is not able to favor a preponderant opinion; it is a case when there is doubt and none of the two matters appear to be more preponderant than the other;
Based on this, we say: If one doubts the number of Rak'ahs, then if one of the two probabilities appears to be more preponderant than the other, he acts according to it, completes his prayer accordingly, and prostrates two prostrations for forgetfulness after concluding the prayer with Salaam.”
For more benefit, please refer to fatwa 237529.
Nevertheless, not prostrating for forgetfulness out of ignorance does not invalidate your prayer in your case. Al-Buhooti said in Ar-Rawdh Al-Murbi’, “The prayer is not invalidated by deliberately leaving a Sunnah prostration for forgetfulness or an obligatory prostration that is desirable to be performed after Salaam.”
Also, the fact that you finished your prayer at the usual time may indicate that you were right and that you did not forget, but we cannot assert anything about it.
Allaah knows best.
You can search for fatwa through many choices