Abu Musa Ashari reported,

A man came to the Prophet ﷺ and asked, "Messenger of Allah, what counts as fighting in the cause of Allah? One of us fights out of anger, and another fights out of tribal loyalty."The Prophet ﷺ raised his head toward him, and he only raised his head because the man was standing, and said, "Whoever fights so that the word of Allah is supreme, he is in the cause of Allah." عز وجل

Bukhari 123

Sahih

حدثنا عثمان قال أخبرنا جرير عن منصور عن أبي وائل

عن أبي موسى قال

جاء رجل إلى النبي ﷺ فقال يا رسول الله ما القتال في سبيل الله فإن أحدنا يقاتل غضبا ويقاتل حمية فرفع إليه رأسه قال وما رفع إليه رأسه إلا أنه كان قائما فقال من قاتل لتكون كلمة الله هي العليا فهو في سبيل الله عز وجل

البخاري 123صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Knowledge
Chapter
One who asks while standing a scholar who is sitting
Numbering
Darussalam 123
Bukhari 123