Terrorist: person who considers common civilian(arbitrary) as party to the conflict and combatant for the govt in power, and causes violent act against them to force them agree to his/her cause
Militant: Person who considers govt machinery(especially forces) to be combatant, and spares the common civilians.
Both above persons are in sound mental condition.
Notice that usually govt forces are not considered terrorists even though they may cause violence against civilians. Nor is attack by enemy forces on civilians is considered terrorism.
Terrorism is quite modern term, and trying to use it against bhagat singh / prof mohammed / Genghis Khan is risky.
Example:
kashmiri armed struggle against indian army: militancy
punjabi armed struggle against indian state: militancy
kashmiri blowing up arbitrary 10 civilians : terrorism
Example of acts not considered terrorism:
salman taseer's murder
taseer was party to conflict, so a target killing, it is not arbitrary killing of some random civilian)
Pakistan army's torture and killing in baluchistan
Indian army's torture and killing in kashmir
snake/tiger killing a human (terrorist has to be human)
Gunman in some school in US emptying his gun on classmates/teachers