The Messenger of Allah ﷺ said one day, after he had finished the prayer and turned to face us, "People, I am your imam, so do not precede me in bowing, in prostrating, in standing, in sitting, or in leaving. For I see you from in front of me and from behind me. By the One in whose hand is my soul, if you saw what I have seen, you would laugh little and weep much."They asked, "Messenger of Allah, what did you see?"He replied, "I saw Paradise and the Fire."
حدثنا محمد بن فضيل حدثنا المختار بن فلفل
قال رسول الله ﷺ ذات يوم وقد انصرف من الصلاة فأقبل إلينا فقال يا أيها الناس إني إمامكم فلا تسبقوني بالركوع ولا بالسجود ولا بالقيام ولا بالقعود ولا بالانصراف فإني أراكم من أمامي ومن خلفي وايم الذي نفسي بيده لو رأيتم ما رأيت لضحكتم قليلا ولبكيتم كثيرا قالوا يا رسول الله وما رأيت قال رأيت الجنة والنار
Its chain of transmission is sahih, and the hadith is found in Muslim 1/320, no. 426, in the Book of Prayer, on the prohibition of preceding the imam, and in Nasai 3/83, no. 1263, in the Book of Forgetfulness, on the prohibition of anticipating the imam.