(a) Sayyiduna Abdullah bin Buhaynah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) led us in prayer, and he (peace and blessings be upon him) stood up in the first two rak'ahs without sitting, and continued his prayer. When he had completed his prayer, the people were waiting for him (peace and blessings be upon him) to give the salam. He (peace and blessings be upon him) said the takbir and prostrated before giving the salam, then raised his head, then said the takbir and performed the second prostration, then raised his head and gave the salam.
It is an established hadith; there is no doubt about its authenticity.
(b) In a narration of al-Zuhri (may Allah have mercy on him): The Messenger of Allah (peace and blessings be upon him) performed the prostration of forgetfulness both before the salam and after it, and the last of the two practices was the one before the salam.
However, this statement of al-Zuhri is munqati' (broken): he did not attribute it to any of the Companions, and Mutarrif bin Mazin is not strong.
(c) In another narration, Sayyiduna Abu Hurayrah (may Allah be pleased with him) mentioned the prayer of the Prophet (peace and blessings be upon him) and his forgetfulness, and then al-Zuhri (may Allah have mercy on him) said: That was before Badr, and afterwards the rulings became firmly settled.
(d) This is what has reached us from al-Zuhri (may Allah have mercy on him) on this matter, except that the one who narrated this story to al-Zuhri did not mention the prostrations of forgetfulness to him, and he held that the Prophet (peace and blessings be upon him) did not perform the two prostrations of forgetfulness on the day of Dhul-Yadayn or Dhul-Shimalayn (may Allah be pleased with him), as we shall mention. In sha' Allah (if Allah wills).
Others, however, have established his two prostrations of forgetfulness on the day of Dhul-Yadayn (may Allah be pleased with him) from Abu Salamah, Ibn Sirin and Abu Sufyan (may Allah have mercy on them), through Sayyiduna Abu Hurayrah (may Allah be pleased with him); and the well-known fatwa of al-Zuhri (may Allah have mercy on him) is that the prostrations of forgetfulness are performed before the salam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3836