The order of precedence within the U.S. Department of Defense is set by DoD Directive 1005.8 and is not dependent on the date of creation by the U.S. Congress.
Prior to 1967, the U.S. Coast Guard was a part of the U.S. Department of the Treasury. In 1967 it became a part of the U.S. Department of Transportation. In 2002 it was placed under the DHS. During time of war it may be transferred to the Department of the Navy, under the Department of Defense.
The six uniformed services that make up the United States Armed Forces are defined in the previous clause
The term "armed forces" means the Army, Navy, Air Force, Marine Corps, Space Force, and Coast Guard.
All eight uniformed services are subject to the provisions of 10 USC 1408, the Uniformed Services Former Spouses Protection Act.
U.S. Armed Forces
Six of the uniformed services make up the U.S. Armed Forces, five of which are within the U.S. Department of Defense. The Coast Guard is part of the Department of Homeland Security and has both military and law enforcement duties. Title 14 states that the Coast Guard is part of the armed forces at all times, making it the only branch of the military outside the Department of Defense. During a declared state of war, however, the President or Congress may direct that the Coast Guard operate as part of the Department of the Navy. The U.S. Public Health Service Commissioned Corps, along with the NOAA Commissioned Corps, operate under military rules with the exception of the applicability of the Uniform Code of Military Justice, to which they are subject only when militarized by executive order or while detailed to any component of the armed forces. Reserve components of the United States Armed Forces are all members of the military who serve in a reserve capacity. The National Guard is an additional reserve military component of the Army and Air Force, respectively, and is composed of National Guard units, which operate under Title 32 and under state authority as the Army National Guard and Air National Guard. The militia that later became the National Guard was first formed in the Colony of Virginia in 1607 and is the oldest uniformed military force founded in the New World. The National Guard can also be mobilized by the President to operate under Federal authority through Title 10. When acting under federal direction, the National Guard is managed by the National Guard Bureau, which is a joint Army and Air Force activity under the Department of Defense, with a 4-star general from the Army or Air Force appointed as its top leader. However, in Federal service command and control of National Guard organizations will fall under the designated Geographic or Functional Combatant Commander. The National Guard of the United States serves as a reserve component for both the Army and the Air Force and can be called up for federal active duty in times of war or national emergencies.
Non-armed uniformed services
The National Oceanic and Atmospheric Administration Commissioned Officer Corps is a uniformed branch of the National Oceanic and Atmospheric Administration, which is under the Department of Commerce.
Commissioned officers of NOAA and PHS wear uniforms that are derived from U.S. Navy and Coast Guard uniforms, except that the commissioning devices, buttons, and insignia reflect their specific service. Uniformed officers of NOAA and PHS are paid on the same scale as members of the armed services with respective rank and time-in-grade. Additionally, PHS Officers are covered by the Uniformed Services Employment and Reemployment Act and the Servicemembers Civil Relief Act. PHS and NOAA consist of commissioned officers only and have no warrant officer ranks or enlisted ranks. Commissioned officers of the PHS and NOAA may be militarized by the President. Because they are commissioned officers, they can be classified as prisoners of war under the Geneva Conventions, if captured by a belligerent entity. The United States Coast and Geodetic Survey, a predecessor to NOAA, originally began commissioning its officers so that if captured while engaged in battlefield surveying, they would be protected under the Law of Armed Conflict and could not be tried or executed as spies. The USC&GS Commissioned Officer Corps became the Environmental Science Services Administration Corps, upon the creation of the Environmental Science Services Administration on 13 July 1965, then became the NOAA Corps upon the creation of NOAA on 3 October 1970. The PHS traces its origins to a system of marine hospitals created by "An Act for the relief of sick and disabled seamen", passed by Congress in 1798; it adopted a military model of organization in 1871.