The Messenger of Allah ﷺ went out to make peace between the tribe of Amr bin Awf. The time for prayer arrived, and the muadhdhin came to Abu Bakr and asked him to gather the people and lead them in prayer. Then the Messenger of Allah ﷺ arrived, made his way through the rows, and stood in the front row. The people clapped to alert Abu Bakr to the presence of the Messenger of Allah ﷺ, but Abu Bakr did not turn around during prayer. When they persisted, he realized that something had happened in their prayer, so he turned and saw the Messenger of Allah ﷺ.The Messenger of Allah ﷺ gestured to him to stay where he was. Abu Bakr raised his hands and praised Allah and thanked Him for what the Messenger of Allah ﷺ had said, then stepped backward. The Messenger of Allah ﷺ moved forward and led the prayer.When he had finished, he said to Abu Bakr, "What prevented you from continuing to pray when I gestured to you?"Abu Bakr replied, "It is not fitting for the son of Abu Quhafa to lead the Messenger of Allah ﷺ in prayer."Then he said to the people, "Why did you clap? Clapping is for women. If something happens during your prayer, say Subhan Allah."
أخبرنا محمد بن عبد الله بن بزيع قال حدثنا عبد الأعلى بن عبد الأعلى قال حدثنا عبد الله وهو ابن عمر عن أبي حازم
انطلق رسول الله ﷺ يصلح بين بني عمرو بن عوف فحضرت الصلاة فجاء المؤذن إلى أبي بكر فأمره أن يجمع الناس ويؤمهم فجاء رسول الله ﷺ فخرق الصفوف حتى قام في الصف المقدم وصفح الناس بأبي بكر ليؤذنوه برسول الله ﷺ وكان أبو بكر لا يلتفت في الصلاة فلما أكثروا علم أنه قد نابهم شيء في صلاتهم فالتفت فإذا هو برسول الله ﷺ فأومأ إليه رسول الله ﷺ أي كما أنت فرفع أبو بكر يديه فحمد الله وأثنى عليه لقول رسول الله ﷺ ثم رجع القهقرى وتقدم رسول الله ﷺ فصلى فلما انصرف قال لأبي بكر ما منعك إذ أومأت إليك أن تصلي فقال أبو بكر رضي الله عنه ما كان ينبغي لابن أبي قحافة أن يؤم رسول الله ﷺ ثم قال للناس ما بالكم صفحتم إنما التصفيح للنساء ثم قال إذا نابكم شيء في صلاتكم فسبحوا
Muslim narrated it in the book of Prayer, chapter on appointing someone from the congregation to lead them in prayer when the imam is delayed, etc., hadith 421, from Muhammad bin Abdullah bin Buzai. Bukhari narrated it in the book of adhan, chapter on one who enters to lead the people in prayer and then the imam arrives... etc., hadith 1106, hadith 684, from the hadith of Abu Hazim, with the same chain, and it is also in Kubra.