Sahih Muslim 1904a
It has been narrated on the authority of Abu Musa Ash'ari that a desert Arab came to Prophet ﷺ and said: Messenger of Allah, one man fights fgr the spoils of war;
another fights that he may be remembered, and another fights that he may see his (high) position (achieved as a result of his valour in fighting). Which of these is fighting in the cause of God? The Messenger of Allah ﷺ said: Who fights so that the word of Allah is exalted is fighting in the way of Allah.
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، وَابْنُ، بَشَّارٍ - وَاللَّفْظُ لاِبْنِ الْمُثَنَّى - قَالاَ حَدَّثَنَا مُحَمَّدُ، بْنُ جَعْفَرٍ حَدَّثَنَا شُعْبَةُ، عَنْ عَمْرِو بْنِ مُرَّةَ، قَالَ سَمِعْتُ أَبَا وَائِلٍ، قَالَ حَدَّثَنَا أَبُو مُوسَى، الأَشْعَرِيُّ أَنَّ رَجُلاً، أَعْرَابِيًّا أَتَى النَّبِيَّ ﷺ فَقَالَ يَا رَسُولَ اللَّهِ الرَّجُلُ يُقَاتِلُ لِلْمَغْنَمِ وَالرَّجُلُ يُقَاتِلُ لِيُذْكَرَ وَالرَّجُلُ يُقَاتِلُ لِيُرَى مَكَانُهُ فَمَنْ فِي سَبِيلِ اللَّهِ فَقَالَ رَسُولُ اللَّهِ ﷺ " مَنْ قَاتَلَ لِتَكُونَ كَلِمَةُ اللَّهِ أَعْلَى فَهُوَ فِي سَبِيلِ اللَّهِ " .