Thomas Jefferson ran for president 3 times. The first time that he ran, he lost to john Adams from the federalist party. The second time Thomas Jefferson ran john Adams ran too. Thomas Jefferson finally prevailed that time and ran a second time 4 years later.
Yes, they were friends. Thomas Jefferson was good friends with Lewis's father, who died in the Revolutionary War. They were neighbors for many years, and when Jefferson became president, he made Meriwether Lewis his personal secretary.
Thomas Jefferson was a democratic republican. Alexander Hamilton was a federalists. The two parties had different political views. They often disagreed on things such as, how many years you had to be a citizen of the US to vote.
Thomas Jefferson had not yet been elected as President or as any other type of colonial official when he wrote the Declaration of Independence. He was a delegate to the Second Continental Congress, but he was appointed to that position, not elected.