Hadith 1020
Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates that the Noble Prophet (peace and blessings be upon him) said: "Indeed, Satan comes to one of you while he is performing his prayer, and he confuses his prayer for him, until he does not know how many rak‘ahs he has prayed. So whoever faces such a situation should perform two prostrations while sitting." The meaning of the narration from Yahya bin Abi Kathir and Muhammad bin ‘Amr is also similar, that Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates from the Noble Prophet (peace and blessings be upon him) that he said: "Until the state of the one praying becomes such that he does not know how many rak‘ahs he has prayed, whether three or four? So he should perform two prostrations while sitting (in tashahhud)."
Hadith 1021
Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) narrates from the Noble Prophet (peace and blessings of Allah be upon him) that he (peace be upon him) said: "When a person (the one praying) forgets and does not know how many units of prayer he has performed, then he should perform two prostrations while he is sitting (in Tashahhud)."
Hadith 1022
وَفِي خَبَرِ عِيَاضٍ ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " إِذَا سَهَا فَلَمْ يَدْرِ كَمْ صَلَّى فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ " . وَفِي خَبَرِ عَبْدِ اللَّهِ بْنِ جَعْفَرٍ ، وَمُعَاوِيَةَ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " مَنْ شَكِّ فِي صَلاتِهِ ، فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ " . خَرَّجْتُ هَذِهِ الأَخْبَارَ بِأَسَانِيدِهَا فِي كِتَابِ الْكَبِيرُ ، وَهَذِهِ اللَّفْظَةُ مُخْتَصَرَةٌ غَيْرُ مُتَقَصَّاةٍ
In the narration from Sayyiduna Abdullah bin Ja'far and Sayyiduna Muawiyah (may Allah be pleased with them both) from the Prophet (peace and blessings be upon him), it is stated: "Whoever has doubt in his prayer should perform two prostrations while sitting in Tashahhud." (The author of the book states:) I have mentioned these ahadith with their chains of narration in Kitab al-Kabir. And these words are brief and not detailed.