Sahih al-Bukhari, Book 56, Hadith 26 (In-Book)

Narrated Abu Musa: A man came to the Prophet and asked, "A man fights for war booty; another fights for fame and a third fights for showing off; which of them fights in Allah's Cause?" The Prophet said, "He who fights that Allah's Word (i.e. Islam) should be superior, fights in Allah's Cause."

حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا شُعْبَةُ، عَنْ عَمْرٍو، عَنْ أَبِي وَائِلٍ، عَنْ أَبِي مُوسَى ـ رضى الله عنه ـ قَالَ جَاءَ رَجُلٌ إِلَى النَّبِيِّ صلى الله عليه وسلم فَقَالَ الرَّجُلُ يُقَاتِلُ لِلْمَغْنَمِ، وَالرَّجُلُ يُقَاتِلُ لِلذِّكْرِ، وَالرَّجُلُ يُقَاتِلُ لِيُرَى مَكَانُهُ، فَمَنْ فِي سَبِيلِ اللَّهِ قَالَ ‏ "‏ مَنْ قَاتَلَ لِتَكُونَ كَلِمَةُ اللَّهِ هِيَ الْعُلْيَا فَهُوَ فِي سَبِيلِ اللَّهِ ‏" ‏‏.‏

sunnah.com