The Messenger of Allah ﷺ led us in one of the two afternoon prayers. He prayed two rakahs with us and then gave the salam. He went over to a piece of wood lying across the mosque and leaned on it as though he were angry, placing his right hand on his left and interlacing his fingers.
صلى بنا رسول الله ﷺ إحدى صلاتي العشي، فصلى بنا ركعتين ثم سلم، فقام إلى خشبة معروضة في المسجد فاتكأ عليها كأنه غضبان ووضع يده اليمنى على يده اليسرى، وشبك بين أصابعه…
Bukhari narrated it in the Book of Prayer (482), and Muslim in the Book of Mosques (573), both from the hadith of Muhammad bin Sirin, from Abu Hurairah, relating the same, and the wording is Bukhari's. See its detailed sourcing in the collected chapters on inattentiveness (sahw).