From and after the passage of this act it shall not be lawful to employ any part of the Army of the United States, as a posse comitatus, or otherwise, for the purpose of executing the laws,except in such cases and under such circumstances as such employment of said force may be expressly authorized by the Constitution or by act of Congress ;
https://www.quora.com/How-did-Eisenhower-not-violate-the-Posse-Comitatus-Act-by-sending-soldiers-to-Little-Rock
The Constitution permits Congress to authorize the use of the militia “to execute the Laws of the Union, suppress Insurrections and repel Invasions.” And it guarantees the states protection against invasion or usurpation of their “republican form of government,” and, upon the request of the state legislature, against “domestic violence.” These constitutional provisions are reflected in the Insurrection Acts, which have been invoked numerous times both before and after passage of the Posse Comitatus Act, 18 U.S.C. Section 1385, in 1878. Congress has also enacted a number of statutes that authorize the use of the land and naval forces to execute their objective
The express statutory exceptions include the legislation that allows the President to use military force to suppress insurrection or to enforce federal authority, 10 U.S.C. Sections 331-335, and laws that permit the Department of Defense to provide federal, state and local police with information, equipment, and personnel, 10 U.S.C. Sections 371-382.
https://www.everycrsreport.com/reports/R42659.html