What Is Terrorism?
UN Security Council Resolution 1566 (2004) defines Terrorism as the deliberate killing, serious harming, or hostage-taking of civilians in order to terrorize people or force a government to act, in a way terrorists want.

With the above definition, terrorism could be carried out as below.
Individuals and groups, meaning people or organized networks who carry out attacks.

State-sponsored actors, where any government supports or directs groups or agents who carry out attacks.
Direct state action, where military or security forces themselves use violence to terrorize civilians.

It has to be noted that military action alone is not terrorism. What matters is the conduct and the purpose. A state's use of force shall be judged by how it treats civilians. In the same way a group is also judged.
References:

- Qur'an 2:190 - Fight in the cause of Allah with those who fight against you, but do not exceed the limits. Allah does not like transgressors.
- Qur’an 2:193 - Hence, fight against them until there is no more oppression and all worship is devoted to God alone; but if they desist, then all hostility shall cease, except against those who (willfully) do wrong.
- Qur’an 4:75 - And what reason do you have not to fight in the cause of Allah, to rescue the helpless oppressed old men, women, and children who are crying: "Our Rabb! Deliver us from this town whose people are oppressors; send us a protector by Your grace and send us a helper from Your presence?"

- Sunan Tirmidhi reported (1621) narration of Fadalah bin 'Ubaid (ra):
- That the Messenger of Allah (ﷺ) said: "The deeds of everyone who dies are sealed. Except for the one who dies guarding the frontier from the enemy, in the cause of Allah. For indeed his actions are increased for him until the Day of Judgement, and he is secure from the tribulation of the grave." And I heard the Messenger of Allah (ﷺ) saying: "The Mujahid is one who strives against his own soul."

- There are similar narrations on this topic from 'Uqbah bin 'Amir (ra) and Jabir bin Abdullah.
- Sunan Abu Dawood reported (4344) narration of AbuSa'id al-Khudri (ra):

- The Prophet (ﷺ) said: The best fighting (jihad) in the path of Allah is (to speak) a word of justice to an oppressive ruler.
- UN Security Council Resolution 1566; ICRC Customary IHL, Rule 2.
