In time of peace, no enlisted member of the National Guard may be discharged before the expiration of the member's period of enlistment, except:
(1) By order of the President or secretary of defense;
(2) By sentence of a general court-martial;
(3) By direction of the Governor on account of disability, on account of sentence of imprisonment by civil court, on account of a bona fide permanent change of residence to another state or territory, or as provided for by regulations established by the secretary of defense;
(4) In compliance with an order of one of the United States courts on writ of habeas corpus.