It wasnarrated that Abu Musa said:
"The Prophet (ﷺ) was askedabout aman who fights to prove his courage, or out of pride andhonour forhis close relatives, or to show off. The Messenger of Allah(ﷺ)said: 'Whoever fights so that the Word of Allah may be supremeisthe one who (is fighting) in the cause of Allah.'"
English reference: Vol. 4, Book 24, Hadith 2783
Arabic reference: Book 24, Hadith 2889