Except as provided under section 637(b) or 637a of this title, each officer of the Regular Army, Regular Air Force, Regular Marine Corps, or Regular Space Force who holds the regular grade of brigadier general, and each officer of the Regular Navy who holds the regular grade of rear admiral (lower half), who is not on a list of officers recommended for promotion to the regular grade of major general or rear admiral, respectively, shall, if not earlier retired, be retired on the first day of the first month beginning after the date of the fifth anniversary of his appointment to that grade or on the first day of the month after the month in which he completes 30 years of active commissioned service, whichever is later.