The Prophet (peace and blessings be upon him) said: “I am a human being like you. I forget as you forget. You should remind me whenever I forget something.”
The moment one enters into Prayer, he should pay attention to the fact that he is standing before His Creator. Consequently, he should not let anything occupy his mind other than Prayer. Sometimes, one becomes absent-minded to the extent that he may forget one of the obligatory or recommended acts of Prayer. Whenever such a thing happens, one should prostrate the two prostrations of forgetfulness known as sujud as-sahw.
we can say that the four Imams have settled the issue as follows:
1- The Hanafi school states that one should perform the two prostrations of forgetfulness immediately after the first taslimah (right salutation). Then, he should make tashahhud and end his Prayer with salutation afterwards.
2- The Maliki school states that he should perform two prostrations before salutation without saying the tashahhud. However, if he offers the two prostrations of forgetfulness after the taslim, then he should say complete tashahhud and repeat the taslim.
3- The adherents of Shafi`i, on the other hand, maintain that it is sufficient to perform the two prostrations of forgetfulness before taslim.
4- The Hanbali school maintains that one should pronounce takbir first. Then he has the choice whether to perform the two prostrations after taslim or not. However, if he performs the two prostrations after taslim, he should say tashahhud before taslim.