Answered by Mufti Mohammed Tosir Miah
Forgetting the number of rakaats in Salah
If a person’s doubt arises after finishing the Salah, then such a doubt will not be taken into consideration, unless one is certain he has missed out a rakaat.
There is a principle in Islamic jurisprudence which is:
“Certainty is not lifted by a doubt.” (Al Ashbah Wan Nadhair p.60)
If one doubts the number of rakaats, then if this is the first time it happened in one’s life, then the prayer of that person will become invalid.
If the doubts occur a second time in one’s life and thereafter a third, fourth time etc… then there are two rulings:
One should act upon his predominant view i.e. what he most likely thinks (Zann Ghalib) in this situation, one does not have to perform Sajdah Sahwe.
If one does not have a predominant view then he is to take with the minimum that he knows he has completed i.e. if the doubt is between two or three then he will continue with his prayer from rakaat two. In this situation, one has to perform Sajdah Sahwe. (Fatawa Darul Uloom Deoband p.418 v.4 & Raddul Muhtar p.562 v.2)
Only Allah Knows Best
Mohammed Tosir Miah
Darul Ifta Birmingham