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