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, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
He said: “If he doubts the number of Rak‘ahs he performed in the prayer, then he should proceed according to Ghalabat-uth-Thann (what he believes is more likely) then perform Sujood as-Sahw after Tasleem. If he cannot determine what is more likely (when neither appears more likely to be the case), he should proceed on the basis of what is certain, namely the lesser number, and complete his prayer accordingly, then perform Sujood as-Sahw before Tasleem ... Another question remains: whether there is a difference between an Imaam, a Munfarid and a Ma’moom (the one who is led in the prayer), or are they the same in this regard?
The answer: Some scholars differentiated between the Imaam and others. They held that the Imaam should proceed on the basis of Ghalabat-uth-Thann while the Ma'moom and Munfarid should proceed only on the basis of Yaqeen (what is certain), namely the lesser number, and complete their prayer accordingly. The reason for this difference according to those scholars is that there is someone to warn the Imaam when he makes a mistake, unlike the others. But the Hadeeth narrated by Ibn Mas'ood that we mentioned earlier indicates that he should proceed according to Ghalabat-uth-Thann, whether he is an Imaam, a Ma'moom or a Munfarid.” [Ash-Sharh Al-Mumti’]
Regarding the person who has frequent Waswasah (obsessive doubts), he does not have to make Sujood as-Sahw. He should simply ignore those doubts. The Hanbali scholar Al-Mardaawi said: “When a person constantly experiences doubts during his prayer to the point that they become like obsessive whisperings, he should ignore such doubts because this results in a kind of obstinacy, and thus he performs more Rak‘ahs (than what he is required to perform) although he is certain that he had completed the correct number of Rak‘ahs, and similar behavior. Therefore, he should totally disregard such doubts. The same applies to having doubts during performing Wudhoo’, Ghusl, or removal of Najaasah (impurity)...”[Al-Insaaf]
The Maaliki scholars set a criterion for the constant doubts (ash-Shakk al-Mustankih) - that a person experiences such doubts at least once a day. Shaykh ‘Ulaysh (from the Maaliki school) underlined this in his book Fat-h Al-‘Aliyy Al-Maalik.
Moreover, Maaliki scholars hold that when a person has constant doubts, he should perform Sujood as-Sahw after Tasleem. A dissertation of Ibn Abi Zayd Al-Qayrawaani reads: “When a person has constant doubts regarding Sahw, he should ignore it and he is not obliged to make anything up, but he should perform Sujood as-Sahw after Tasleem. This is for a person who constantly experiences doubts whether he had added or omitted a Rak‘ah of the prayer without being certain about it.”
Allaah Knows best.