The Messenger of Allah ﷺ received word that there was a dispute among the tribe of Amr bin Awf, so he set out with a group of companions to reconcile them. The Messenger of Allah ﷺ was delayed, and the time for the noon prayer came.Bilal went to Abu Bakr and said, "Abu Bakr, the Messenger of Allah ﷺ has been delayed, and the time for prayer has come. Would you lead the people in prayer?"Abu Bakr replied, "Yes, if you wish."So Bilal called the iqamah, and Abu Bakr stepped forward and began the prayer with the people. The Messenger of Allah ﷺ then arrived, walking through the rows until he stood in one of them. The people began to clap. Abu Bakr did not normally turn during his prayer, but when the clapping increased, he looked back and saw the Messenger of Allah ﷺ. The Messenger of Allah ﷺ gestured to him, signaling him to continue leading the prayer. Abu Bakr raised his hands, praised Allah , and stepped backward until he reached the row. The Messenger of Allah ﷺ then went forward and led the people in prayer.When he finished, he turned to the people and said, "People, what is wrong with you that when something happens during the prayer you start to clap? Clapping is only for women. Whoever notices something during his prayer should say, 'Subhan Allah,' for no one hears him say 'Subhan Allah' without turning toward him. Abu Bakr, what prevented you from leading the people in prayer when I signaled to you?"Abu Bakr replied, "It was not fitting for the son of Abu Quhafa to lead the prayer in front of the Messenger of Allah ﷺ."
أخبرنا قتيبة قال حدثنا يعقوب وهو ابن عبد الرحمن عن أبي حازم
أن رسول الله ﷺ بلغه أن بني عمرو بن عوف كان بينهم شيء فخرج رسول الله ﷺ ليصلح بينهم في أناس معه فحبس رسول الله ﷺ فحانت الأولى فجاء بلال إلى أبي بكر فقال يا أبا بكر إن رسول الله ﷺ قد حبس وقد حانت الصلاة فهل لك أن تؤم الناس قال نعم إن شئت فأقام بلال وتقدم أبو بكر فكبر بالناس وجاء رسول الله ﷺ يمشي في الصفوف حتى قام في الصف وأخذ الناس في التصفيق وكان أبو بكر لا يلتفت في صلاته فلما أكثر الناس التفت فإذا رسول الله ﷺ فأشار إليه رسول الله ﷺ يأمره أن يصلي فرفع أبو بكر يديه فحمد الله عز وجل ورجع القهقرى وراءه حتى قام في الصف فتقدم رسول الله ﷺ فصلى بالناس فلما فرغ أقبل على الناس فقال يا أيها الناس ما لكم حين نابكم شيء في الصلاة أخذتم في التصفيق إنما التصفيق للنساء من نابه شيء في صلاته فليقل سبحان الله فإنه لا يسمعه أحد حين يقول سبحان الله إلا التفت إليه يا أبا بكر ما منعك أن تصلي للناس حين أشرت إليك قال أبو بكر ما كان ينبغي لابن أبي قحافة أن يصلي بين يدي رسول الله ﷺ
Bukhari transmitted it in the Chapter on Inattentiveness, section on gesturing during prayer, hadith no. 1234, and Muslim in the Chapter on Prayer, section on the congregation putting forward someone to lead them in prayer, etc., hadith no. 103/421, from Qutayba, with the same wording. It is also found in Kubra, hadith no. 859.