During his work in the Virginia legislature, Madison met lifelong friend Thomas Jefferson (1743-1826), author of the Declaration of Independence and the third president of the United States. As a politician, Madison often fought for religious freedom, believing it was an individualâs right from birth.