The constitutional amendment that GOP have put forward specifically prohibits any president who previously served two consecutive terms. (they had already thought this through, it literally only allows Trump three terms)
“No person shall be elected to the office of the President more than three times, nor be elected to any additional term after being elected to two consecutive terms, and no person who has held the office of President, or acted as President, for more than two years of a term to which some other person was elected President shall be elected to the office of the President more than twice.”
https://www.congress.gov/bill/119th-congress/house-joint-res...