Taylor was the twelfth president of the US under the United States Constitution.
There were 8 1-year presidents under the articles of confederation which preceded the constitution. (John Hansen was the first president Of the US under the articles) If you count this, the 12th president was James Madison
The first president of the continental congress was John Hancock. If you start counting here, the 12th president was Thomas Jefferson.
James Polk resigned a day early so he could get home early. Taylor refused to take the oath on a Sunday. Some believe that Atchison was president for that one day.However, He never took the oath, and his term had expired when congress adjourned; so he was not the 12th president.