The twenty-second amendment to the US Constitution establishes the presidential term limit. The text of the amendment begins (emphasis mine): "No person shall be elected to the office of the President more than twice". Taken completely literally, this does not restrict who is eligible to become president by means other than election, particularly succession. Of course, courts do not always interpret the Constitution completely literally, and if a former two-term president was selected as vice president, it would ultimately fall to the courts to decide whether the Constitution permits this. Given the lack of precedent, it is hard to have much confidence in what the outcome would be.
Peabody and Gant argue in a 1999 article in the Minnesota Law Review (The Twice and Future President: Constitutional Interstices and the Twenty-Second Amendment) that not only does the Constitution permit Bill Clinton to be elected as vice president, but it also permits him to act as president in the event the elected president became unable to serve. This opinion piece from a few months ago at the Washington Post has an interesting discussion.