كتاب الصلاة
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 419 b

Anas reported:

The last glance that I have had of the Messenger of Allah (ﷺ) (before his death) was that when he on Monday drew the curtain aside. The hadith transmitted by Salih is perfect and complete.
وَحَدَّثَنِيهِ عَمْرٌو النَّاقِدُ، وَزُهَيْرُ بْنُ حَرْبٍ، قَالاَ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنِ الزُّهْرِيِّ، عَنْ أَنَسٍ، قَالَ آخِرُ نَظْرَةٍ نَظَرْتُهَا إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم كَشَفَ السِّتَارَةَ يَوْمَ الاِثْنَيْنِ بِهَذِهِ الْقِصَّةِ وَحَدِيثُ صَالِحٍ أَتَمُّ وَأَشْبَعُ ‏.‏
Reference : Sahih Muslim 419b
In-book reference : Book 4, Hadith 107
USC-MSA web (English) reference : Book 4, Hadith 841
  (deprecated numbering scheme)