You can only be elected as president twice. You can probably hack the system by getting multiple other presidents to select you as vice president, then resign. If you serve more than 2 years of the term they were elected to, that reduces the number of times you can be elected as president to one.
The 22nd amendment doesn’t say that someone that serves 3.99 years of another president’s term multiple times can’t still be elected, and it doesn’t say that someone not qualified to be elected as president can’t be elected as vice president, but the 12th amendment might. Either of those could be an interesting legal fight.
The 13th ended slavery. You’re probably thinking of the 12th which says that no person constitutionally ineligible to “be” president can be elected as vice president. Importantly, the 22nd only places limits on being “elected” as president, so it’s not (necessarily) creating a constitutional requirement to “be” president by some other means.
Like I said, it could be an interesting legal fight if it even came up.