Shaykh Ibn ‘Uthaymeen said: Jihad is obligatory and becomes fard ‘ayn 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 (interpretation of the meaning):
“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.