1- If one is certain that he absentmindedly added a rak'a, a bow, a prostration, a standing, or the like, then he is recommended to prostrate for forgetfulness.
2- If one is uncertain whether he performed three or four rak'as, then he is obligated to perform another rak'a then prostrate for forgetfulness, for the above mentioned hadith narrated by Abu Sa'id Al-Khadari (G. p. H), and because one was unsure whether he performed four raka's or five.
If one's doubts decapitate before salam and before prostrating (for forgetfulness) and he realizes that the performed rak'a is the fourth
he is still recommended to prostrate, for hesitancy (One who is praying should not accept what others, even if many, tell him about the number of rak'as he has performed, or any other matter.
Rather, he should adopt his own belief as to whether he has
added or omitted something)
The criterion for uncertainty and its elimination is that if what one performed in doubt is necessary anyway, then one does not prostrate for forgetfulness, and if it is possibly extra then one prostrates.
For example, if one suspects while standing up in Thuhr whether the
current rak'a is his third or fourth, and he bows and prostrates while in doubt then he intends to stand up to perform an additional rak'a to be certain (of the number of rak'as), then if he recalls before standing up to perform the additional rak'a that the last was third or fourth, then one does not have to prostrate because what he had performed, while uncertain, is necessary anyway. (pa: 183)
However, if one does not recall until he stands up for the additional rak'a, then he prostrates for forgetfulness even if he becomes certain that it is the fourth, because the possibility that what he had
performed is extra and it being the fifth, existed when he stood up.
-f-When does a follower prostrate for the forgetfulness of his imam and when does he prostrate for his own forgetfulness.