“Each domestic deployment of troops to any of the 50 states or U.S. territories are governed overall by Chairman of the Joint Chiefs of Staff Instruction 3121.01B, ‘Standing Rules of Engagement, Standing Rules for the Use of Force by U.S. Forces.’ However each mission is unique and the rules can be slightly adjusted at a commander’s request. All active duty forces dispatched to the border are governed by the 1878 Posse Comitatus Act, which forbids troops from carrying out law enforcement duties inside United States territory unless Congress grants an exemption. Under the act, federal military forces are prohibited from engaging in direct law enforcement, which includes making arrests, conducting searches, seizures, apprehension, evidence collection, interrogations, security patrols, seizures, stop and frisks, surveillance, crowd and traffic control, enforcement of a quarantine or isolation, or other similar police functions. Congress has amended that act some to increase the authorized level of support the military may provide for drug interdiction and to support border patrol.
According to the Congressional Research Service, under the extended support, the military may provide ‘assistance in maintenance or upgrade of equipment; transportation of personnel; establishment and operation of operations or training bases; training of law enforcement personnel; detecting and monitoring traffic within 25 miles of the border; road and fence construction; light installation along smuggling corridors; the establishment of command and control centers and computer networks; the provision of linguist and intelligence analysis services; and aerial and ground reconnaissance.’”
Source: Here are the rules of engagement for troops deploying to the Mexican border