(a) 28 Years of Active Commissioned Service.—Except as provided in subsection (b) and 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 lieutenant colonel, and each officer of the Regular Navy who holds the regular grade of commander, who is not on a list of officers recommended for promotion to the regular grade of colonel or captain, respectively, shall, if not earlier retired, be retired on the first day of the month after the month in which he completes 28 years of active commissioned service.

(b) Exceptions.—Subsection (a) does not apply to the following:

(1) An officer of the Navy or Marine Corps who is an officer designated for limited duty to whom section 8146(e) or 8372 of this title applies.

(2) An officer of the Navy or Marine Corps who is a permanent professor at the United States Naval Academy.