It was narrated that Abu Musa said:
“The Prophet (ﷺ) was asked about a man who fights to prove his courage, or out of pride and honour for his close relatives, or to show off. The Messenger of Allah (ﷺ) said: ‘Whoever fights so that the Word of Allah may be supreme is the one who (is fighting) in the cause of Allah.’”