The twelfth obligation in Hajj is to spend the nights of the eleventh and twelfth [of Thil Hijjah] in Mina. It is necessary to form the niyyah of alqurbah.
If, on the Eid day the pilgrim leaves for Makkah to perform tawaf and sa'y, it is obligatory on him to return to Mina to spend the night there. He who has not refrained from hunting, while in a state of ihram, must also spend the night of the thirteenth in Mina. As a matter of precaution, so must one who has not abstained from sex while in a state of ihram.
Apart from these two categories, the remaining pilgrims can leave Mina after Dhuhr of the twelfth; if, however, they delay their departure till night falls, they must spend the eve of the thirteenth in Mina till dawn.
Rule 426: The pilgrim may embark on leaving Mina and actually leaves the premises he occupies there, but, due to the traffic or any other reason, he gets held up. It then follows that, if it is possible for him to spend the night there, it is obligatory to do so. If, however, it was not feasible, he is permitted to leave Mina. He should, as a matter of precaution, sacrifice a sheep as a kaffarah.
Rule 427: If it becomes obligatory on a person to spend the night in Mina, it is not necessary for him to spend the whole of the following day there also. He needs to stay just long enough to perform rami of the three Jamarat.
Nor is it obligatory to spend the entire night there; it is enough to remain there from the beginning of the night till a little after midnight, or from a little before midnight till dawn.
It is preferable that he should spend the first half of the night there but must not enter Makkah before sunrise, as a matter of preferred precaution.
Rule 428: The exceptions to the rule of staying in Mina are the following categories:
A person who finds it difficult to stay for fear of endangering their life or property;
those spending the whole night in worship in Makkah, except for the time needed to meet necessities like food, drink, etc.;
those who, having performed the tawaf, remain in prayer, then leave Makkah, and get beyond Aqabatil Madaniyyeen. They can sleep en route before getting to Mina, and
people who supply the pilgrims with water.
Rule 429: One who fails to spend the nights in Mina must pay a kaffarah of a sheep for every night, except for the groups in (2), (3) and (4) above.
As a matter of precaution, even those who fail to do so inadvertently or out of ignorance of the rule, or are excused from spending the nights there, must sacrifice a sheep by way of kaffarah.
Rule 430: A person who leaves Mina, then re-enters at night on the eve of the thirteenth for some business, does not need to spend the night there.