I don't think that has been clearly determined. Lawfare has one perspective:
https://www.lawfareblog.com/practica...y-donald-trump
They specifically cite a case of a person who was disqualified from holding office due to having previously fought for the Confederacy, and served as a governor in NC during the civil war, after first having served in Congress and taken an oath to uphold the Constitution. It is, of course, unclear whether that section would apply to Trump; no doubt his defenders would argue that the President is exempt.