كتاب الصلاة
4  
The Book of Prayers
(21)
Chapter: If The Imam Experiences An Excuse, From Illness, Or Travelling, Etc. He May Appoint Someone Else To Lead The People In Prayer; The One Who Offers Prayer Behind The Imam Sitting Because He Is Unable To Stand Must Stand If He Is Able To Do So; And The Abrogation Of Sitting Behind A Sitting Imam For Those Who Are Able To Stand
(21)
باب اسْتِخْلاَفِ الإِمَامِ إِذَا عَرَضَ لَهُ عُذْرٌ مِنْ مَرَضٍ وَسَفَرٍ وَغَيْرِهِمَا مَنْ يُصَلِّي بِالنَّاسِ وَأَنَّ مَنْ صَلَّى خَلْفَ إِمَامٍ جَالِسٍ لِعَجْزِهِ عَنِ الْقِيَامِ لَزِمَهُ الْقِيَامُ إِذَا قَدَرَ عَلَيْهِ وَنَسْخِ الْقُعُودِ خَلْفَ الْقَاعِدِ فِي حَقِّ مَنْ قَدَرَ عَلَى الْقِيَامِ
Sahih Muslim 420

Abu Musa reported:

When the Messenger of Allah (ﷺ) became ill and illness became serious he ordered Abu Bakr to lead the people in prayer. Upon this 'A'isha said: Messenger of Allah, Abd Bakr is a man of tenderly feelings: when he would stand in your place (he would be so much overwhelmed -by grief that) he would not be able to lead the people in prayer. He (the Holy Prophet) said: You order Abu Bakr to lead the people in prayer, and added: You are like the female companions of Yusuf. So Abu Bakr led the prayer (during this period of illness) in the life of the Messenger of Allah (ﷺ).
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ، عَنْ زَائِدَةَ، عَنْ عَبْدِ الْمَلِكِ بْنِ عُمَيْرٍ، عَنْ أَبِي بُرْدَةَ، عَنْ أَبِي مُوسَى، قَالَ مَرِضَ رَسُولُ اللَّهِ صلى الله عليه وسلم فَاشْتَدَّ مَرَضُهُ فَقَالَ ‏"‏ مُرُوا أَبَا بَكْرٍ فَلْيُصَلِّ بِالنَّاسِ ‏"‏ ‏.‏ فَقَالَتْ عَائِشَةُ يَا رَسُولَ اللَّهِ إِنَّ أَبَا بَكْرٍ رَجُلٌ رَقِيقٌ مَتَى يَقُمْ مَقَامَكَ لاَ يَسْتَطِعْ أَنْ يُصَلِّيَ بِالنَّاسِ فَقَالَ ‏"‏ مُرِي أَبَا بَكْرٍ فَلْيُصَلِّ بِالنَّاسِ فَإِنَّكُنَّ صَوَاحِبُ يُوسُفَ ‏"‏ ‏.‏ قَالَ فَصَلَّى بِهِمْ أَبُو بَكْرٍ حَيَاةَ رَسُولِ اللَّهِ صلى الله عليه وسلم ‏.‏
Reference : Sahih Muslim 420
In-book reference : Book 4, Hadith 110
USC-MSA web (English) reference : Book 4, Hadith 844
  (deprecated numbering scheme)