The Twenty-second Amendment says that no person may be elected President more than twice. It also says that a person who held or acted as President for more than two years of another person's term may be elected to the office no more than once. The National Archives text of the amendment has two sections, and the first one sets the limit.
The text of Section 1
The National Archives prints Section 1 as:
"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."
The Legal Information Institute at Cornell reprints the same wording.
How the limit applies
Section 1 sets two different limits, and the length of earlier service in a term to which another person was elected decides which one applies. The archives text covers only election to the office of the President.