The President of the United States, per Article II of the Constitution, acts as commander-in-chief of the armed forces during times of war. However, Congress must have officially declared a state of war before the president can assume direct command. The modern world has muddied the waters regarding what the president can do.
The president can deploy troops without Congress' approval but must notify Congress within 48 hours with a detailed summary of the reasons for sending troops and the expected time frame of involvement. Unless Congress issues an extension, military forces cannot remain in action longer than 60 days as per the War Powers Resolution of 1973.
Per Article I, Section 8 of the Constitution, the president also has the authority to make use of the National Guard if internal uprising is occurring or if a similar state of emergency is in effect.
The president does not have the right to detain or designate enemy combatants without trial; the 2004 case Rasul v. Bush and the 2006 case Hamdan v. Rumsfeld held that the president could not try enemy combatants in a military tribunal. If accused, civilians or enemy combatants have the right to a fair trial in a U.S. court.