واعلم أنه تعالى لما بين وجوب الجهاد بين أنه لا عبرة بصورة الجهاد بل العبرة بالقصد والداعي فالمؤمنون يقاتلون لغرض نصرة دين الله وإعلاء كلمته والكافرون يقاتلون في سبيل الطاغوت وهذه الآية كالدلالة على أن كل من كان غرضه في فعله رضا غير الله فهو في سبيل الطاغوت
تفسير الرازي النساء ٧٦
Know that the Most High, when He made it clear that jihad is an obligation, made it clear that the manner of jihad is of no consequence, rather what matters is the intent and the cause. For the Believers fight with the goal of supporting Allah’s religion [deen] and raising up His word, while the Disbelievers fight in the cause of idols. This verse is an indication that whoever does what he does with the goal of satisfying any other besides Allah, he is in the cause of idols.
Tafsir Al-Razi, Al-nisaa 76