Amir bin Rabia reported,

Amir bin Rabia reported that he saw the Messenger of Allah ﷺ performing voluntary prayer while on his mount, nodding his head in whichever direction it faced. The Messenger of Allah ﷺ did not do this during the obligatory prayers.

Bukhari 1097

Sahih

حدثنا يحيى بن بكير قال حدثنا الليث عن عقيل عن ابن شهاب عن عبد الله بن

عامر بن ربيعة

أن عامر بن ربيعة أخبره قال رأيت رسول الله ﷺ وهو على الراحلة يسبح يومئ برأسه قبل أي وجه توجه ولم يكن رسول الله ﷺ يصنع ذلك في الصلاة المكتوبة

البخاري 1097صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Shortening
Chapter
Coming down for the obligatory prayer
Numbering
Darussalam 1097
Bukhari 1097