The president has no immunity if he has committed an un constitutional act, such as using the military on US soil (Posse Comitatus Act).
He would be impeached and escorted to jail by US Marshalls.
If he’s a Republican, you mean?
Posse Comitatus is a law, not part of the Constitution. You are actually incorrect that using the military on US soil is Constitutionally impermissible. It is explicitly provided for in the Constitution that the militia (if called up by Congress) is commanded by the President, and that it be used to put down an insurrection. One could make a very strong argument that draftees ARE the militia, and that inducting them into one or another branch of the military doesn’t change that, particularly if Congress approves of the call-up and the conflict. Lincoln used the army for exactly that purpose during the Civil War. One can argue whether the Civil War should have been fought or not, and I’m not going to weigh in on that issue at all, but in view of this fact one cannot reasonably argue that the Constitution forbids such an action where Congress has declared war against a domestic enemy.