Abu Musa Ashari reported,

The Messenger of Allah ﷺ was asked about a man who fights out of bravery, a man who fights out of zeal for his tribe, and a man who fights to show off. Which of these is in the path of Allah?He replied, "Whoever fights so that the word of Allah may be supreme is in the path of Allah."

Tirmidhi 1646

Sahih

حدثنا هناد حدثنا أبو معاوية عن الأعمش عن شقيق بن سلمة

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

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

الترمذي 1646صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Virtues of jihad
Chapter
One who fights for showing off and worldly gain
Numbering
Darussalam 1646
Tirmidhi 1646