Well that would not be the only loop hole, as he can run as a independent, as the third term only applies to standing of the party they are a part of.
For example he could not run as a Democrat again, he would have to associate with another party such as independent.
The language of the 22nd Amendment is very simple and clear.
Section 1.
No person shall be elected to the office of the President more than twice, 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 once.
It has nothing to with party affiliation or anything else.