Shaykh Uthaymeen said, “Jihad is obligatory and becomes fard ayn (an individual obligation) if a person is present where fighting is going on. This is the first of the situations in which jihad becomes an individual obligation because,
Allaah says: “O you who believe! When you meet those who disbelieve, in a battlefield, never turn your backs to them. And whoever turns his back to them on such a day — unless it be a stratagem of war, or to retreat to a troop (of his own), — he indeed has drawn upon himself wrath from Allaah. And his abode is Hell, and worst indeed is that destination!” [al-Anfaal 8:16]
The Prophet (peace and blessings of Allaah be upon him) said that running away on the day when the army is advancing is one of the sins that doom a person to Hell.
He said: “Avoid the seven sins that doom a person to Hell…” among which he mentioned running away on the day when the army is advancing (agreed upon).
But Allaah has made exceptions in two cases:
1. When it is a military manoeuvre, in the sense that he is leaving to bring reinforcements.
2. When he is going to join another group, when he has been told that there is a group of Muslims elsewhere who are about to be defeated, so he goes to join them in order to strengthen their numbers. This is subject to the condition that there is no risk to the group he is in; if there is a risk to the group that he is in, then it is not permissible for him to go to the other group. In this case (jihad) is an individual obligation upon him (fard ‘ayn) and it is not permissible for him to leave.
The second situation (in which jihad becomes an individual obligation) is when a city is besieged by the enemy. Then he has to fight in defence of the city, because when the city is besieged there is no alternative but to defend it, for if the enemy is going to prevent people from leaving the city or entering it, and prevent provisions from reaching it, and other things which are well known, then in this case the people of the city are obliged to fight in order to defend their city.
The third situation is when the leader tells the people to mobilize; the leader (imam) is the highest authority in the state, but he need not necessarily be the leader of all the Muslims, because there has been no leader of all the Muslims (khaleefah) for a long time. The Prophet (peace and blessings of Allaah be upon him) said: “Listen and obey, even if you are ruled by an Abyssinian slave.” So if a man becomes a leader, then his word is to be heeded and his commands are to obeyed.”
Ref: Al-Sharh al-Mumti’, 8/10-12
Posted by Abdul Kareem Ibn Ozzie