Let’s see, if the US invades your country, perhaps to change the regime, and you fight the invading force, you’re a terrorist. It makes perfect sense. From Philip Giraldi at strategicculture.com:
There is something unique about how the United States manipulates the “terrorism” label to avoid being accused of carrying out war crimes. When an indigenous militia or an armed insurgency like the Taliban in a country like Iraq or Afghanistan attacks American soldiers subsequent to a U.S. invasion which overthrew the country’s government, it is considered by Washington to be an act of “terrorism.” Terror attacks de facto permit a carte blanche response, allowing virtually anything as retaliation against the parties involved or countries that support them, including the assassination of foreign government officials. But for the attacker, whose perspective is quite different, the incident often could reasonably be described as legitimate resistance to a foreign occupier and much of the world might agree with that assessment.
So, it all comes down to definitions. The United States covers its version of reality through liberal use of the Authorization for Use of Military Force (AUMF) which more-or-less gives a blanket approval to attack and kill “terrorists” anywhere at any time. And how does one become a terrorist? By being included on the U.S. government’s heavily politicized annual list of terrorist groups and material supporters of terrorism. That was the argument that was used by the United States when it killed Iranian General Qassem Soleimani in January, that his organization, the Qods Force, was on the “terrorist” lists maintained by State and the Treasury Department and he was therefore held to be guilty of any and all attacks on U.S. military carried out by Qods or by presumed Iranian surrogate militias.