Abu Musa (May Allah be pleased with him) reported:
A bedouin came to the Prophet (ﷺ) and said: "O Messenger of Allah! One man fights for booty, another fights to win fame, and the third fights for show off." Another narration is: "One fights for displaying his valour, another fights out of his family pride." Another narration is: "One fights out of rage." He asked: "Which of them is fighting in the Cause of Allah?" The Messenger of Allah (ﷺ) said, "The one who fights so that Word of Allah (Islam) be exalted, is the one who fights in the Cause of Allah."[Al-Bukhari and Muslim].
App reference: Book 12, Hadith 59
Arabic/English book reference: Book 12, Hadith 1343