It is narrated from Sayyiduna Abdullah bin Ja'far (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "If a person has doubt in his prayer, he should perform two prostrations of forgetfulness while sitting."
Hadith Referenceمسند احمد / مسند اهل البيت رضوان الله عليهم اجمعين / 1747
Hadith Gradingحکم دارالسلام:إسناده ضعيف، عبدالله بن مسافع لا يعرف بجرح ولا تعديل ومصعب بن شيبة لين الحديث. عقبة والصواب: عتبة بن محمد بن الحارث ليس بمعروف. ثم هو مضطرب، يقول مرة: «وهو جالس» ، ويقول مرة أخرى: «بعد مايسلم.» ويغني عنه حديث أبى هريرة ، خ: 1231 ، 1232، م: 389.