Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:3808

[Machine] Abu Abdullah Al-Hafiz in Al-Fawaid Al-Kabir informed us that Abu Al-Abbas reported to us, who reported to us that Ahmad bin Hazim bin Abu Gharzah narrated from Ja'far, who narrated from Sa'id, meaning the son of Abu Aroobah, from Qatadah, from Anas, from the Prophet ﷺ, who said: "If one of you has doubts in his prayer and he does not know whether he prayed two or three rak'ahs, then he should leave the doubt and act upon certainty." Ja'far said, "This is the opinion of Ibn 'Awf, and likewise it is in the original narration." And Allah knows best.  

البيهقي:٣٨٠٨

أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ فِي الْفَوَائِدِ الْكَبِيرِ لِأَبِي الْعَبَّاسِ ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا أَحْمَدُ بْنُ حَازِمِ بْنِ أَبِي غَرَزَةَ أنبأ جَعْفَرٌ أنبأ سَعِيدٌ يَعْنِي ابْنَ أَبِي عَرُوبَةَ عَنْ قَتَادَةَ عَنْ أَنَسٍ عَنِ النَّبِيِّ ﷺ قَالَ إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلَمْ يَدْرِ اثْنَتَيْنِ صَلَّى أَوْ ثَلَاثًا فَلْيُلْقِ الشَّكَّ وَلْيَبْنِ عَلَى الْيَقِينِ جَعْفَرٌ هَذَا هُوَ ابْنُ عَوْفٍ وَكَذَا كَانَ فِي الْأَصْلِ سَعِيدٌ يَعْنِي ابْنَ أَبِي عَرُوبَةَ وَاللهُ أَعْلَمُ