"The President" is the "Commander and Chief" of the military
Article II Section 2 of the U.S. Constitution, the Commander in Chief clause, states that "[t]he President shall be Commander in Chief of the Army and Navy of the United States, and of the Militia of the several States, when called into the actual Service of the United States."
The president decides where troops shall be stationed, where ships shall be sent, and how weapons shall be used. All military generals and admirals take their orders from the president.