Sheikh Bin Baz was asked;
Some of the Imams make the prostration of forgetfulness after the tasleem (salaam), and some of them perform it before the tasleem. As well, some of them make it before sometimes and after sometimes. So when is the correct time in which it was legislated to do so before the tasleem, and when is it legislated to do so after it. Also, we would like to know, is the ruling for that which was legislated to prostrate for before and after the salaams, is it an obligation or something that is recommended?
The Sheikh replied;
The situation is one that can be performed in more than one way. Both situations are permissible to do. These two ways that we are talking about are performing the prostration before the salaams as well as after it. This is because the narrations that have come from the Prophet (صلى الله عليه و سلم) talking about this, mention both ways. The best way though is that you make the prostration before the salaam except in two situations:
The first: If you make the tasleem and leave out a raka’a (unit of prayer) or more than one. Than in this case it is better that you make the prostration of forgetfulness after you have completed the prayer, made the tasleem (salaams), which is what we see was done by the Prophet (صلى الله عليه و سلم) when he made the tasleem and left out two rakaat in the hadeeth of Abi Hurairah (رضي الله عنه). We also see this when he ()left out one rakaat in the hadeeth of ‘Umraan bin Husain (رضي الله عنه). In both of these cases he (صلى الله عليه و سلم) made the prostration of forgetfulness after both the completion of the prayer as well as the tasleem.
The second: If he (صلى الله عليه و سلم) had doubt about his prayer. In this situation he didn’t know whether he prayed three or four rakaa’at in one of the prayers that there are four units that are supposed to be prayed, or if he prayed two or three for the magrib prayer. He (صلى الله عليه و سلم) also did this if he was not sure if he prayed one or two units during the fajr prayer. When he was pretty sure about one or the other, then He (صلى الله عليه و سلم) would base his prayer off of that which he was sure of, and make his prostration of forgetfulness after the tasleem (salaam). This is the best way because of the hadeeth of Ibn Masood (رضي الله عنه) and Allah knows best.
[Taken from Majmoo’ al Fatawah by Sheikh Bin Baaz]
[Translated by Abi Abdillah Abdul Lateef]