the Messenger of Allāh ﷺ commanded Abū Bakr to lead the prayer during his illness, so Abū Bakr was leading the people in prayer. 'Urwah said: Then the Messenger of Allāh ﷺ felt some improvement in his condition, so he came out of the chamber, and at that time Abū Bakr was leading the people in prayer. Then when Abū Bakr saw the Messenger of Allāh ﷺ, he stepped back. So he gestured that he should remain as he was. Then the Messenger of Allāh ﷺ sat beside Abū Bakr. So Abū Bakr was following the prayer of the Messenger of Allāh ﷺ, and the people were praying following Abū Bakr's prayer (upon his takbīrs).
حَدَّثَنَا زَكَرِيَّاءُ بْنُ يَحْيَى، قَالَ حَدَّثَنَا ابْنُ نُمَيْرٍ، قَالَ أَخْبَرَنَا هِشَامُ بْنُ عُرْوَةَ، عَنْ أَبِيهِ، عَنْ عَائِشَةَ، قَالَتْ أَمَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم أَبَا بَكْرٍ أَنْ يُصَلِّيَ بِالنَّاسِ فِي مَرَضِهِ، فَكَانَ يُصَلِّي بِهِمْ. قَالَ عُرْوَةُ فَوَجَدَ رَسُولُ اللَّهِ صلى الله عليه وسلم فِي نَفْسِهِ خِفَّةً، فَخَرَجَ فَإِذَا أَبُو بَكْرٍ يَؤُمُّ النَّاسَ، فَلَمَّا رَآهُ أَبُو بَكْرٍ اسْتَأْخَرَ، فَأَشَارَ إِلَيْهِ أَنْ كَمَا أَنْتَ، فَجَلَسَ رَسُولُ اللَّهِ صلى الله عليه وسلم حِذَاءَ أَبِي بَكْرٍ إِلَى جَنْبِهِ، فَكَانَ أَبُو بَكْرٍ يُصَلِّي بِصَلاَةِ رَسُولِ اللَّهِ صلى الله عليه وسلم وَالنَّاسُ يُصَلُّونَ بِصَلاَةِ أَبِي بَكْرٍ.
Reference: Sahih Al Bukhari 683