John Quincy Adams
While he was a member of the Senate, John Quincy Adams was also a professor of logic and oratory at Harvard University. Adams was selected for a Boylston Professorship of Rhetoric and Oratory at Harvard. (The professorship was named after Dr. Thomas Boylston, the grandfather of Abigail Adams). According to biographer Fred Kaplan, Adams was up front with his students when he told them that he had never taught or studied oratory before, and proposed that they learn together. He was a prolific reader of classical literature and lectured his students about the Ciceronian model of the citizen-orator who used oratory to promote the welfare of society. Adams was also influenced by British philosopher David Hume. He wrote a textbook for the class entitled "Lectures on Rhetoric and Oratory", and he argued that advocacy had become a dying art, but that it would flourish in the United States where, unlike France or Great Britain, democratic principles were paid greater deference. He ceased teaching in 1809 when he was appointed as the first United States Minister (Ambassador) to Russia.

William Howard Taft
In 1913 after leaving the Presidency, but eight years before becoming Chief Justice of the United States Supreme Court, William Howard Taft was appointed the Chancellor Kent Professor of Law and Legal History at Yale Law School. While at Yale, Taft was initiated as an honorary member of the Acacia Fraternity. At the same time, Taft was elected president of the American Bar Association. He spent much of his time writing newspaper articles and books, including a series on American legal philosophy. Taft was an opponent of prohibition in the United States, and he correctly predicted the problems created by the Eighteenth Amendment. He also continued to advocate world peace through international arbitration, urging nations to enter into arbitration treaties with each other. Taft also lectured on Legal Ethics at Boston University from 1918 to 1921.
Woodrow Wilson
Woodrow Wilson taught at Cornell University from 1886–1887, where he taught literature, and at Bryn Mawr College from 1885 until 1888, where he taught ancient Greek and Roman history. In 1888 Wilson left Bryn Mawr for Wesleyan University where he taught similar subjects. But it wasn't until he was on the faculty of Princeton University, commencing in 1890 that he taught law. He was the the Chair of Jurisprudence and Political Economy there. Concurrently, he became the first lecturer of Constitutional Law at New York Law School where he taught the course with future Chief Justice and Republican Presidential candidate Charles Evans Hughes. But Wilson did not like the practice of law, and as an academic, he was more interested in government. His first political scholarly book was entitled "Congressional Government". Published in 1885, it advocated a parliamentary system, and provided a critical description of America's government, in which he argued that the American system of government was inferior to Parliamentary governments. Critics complained that the book was written without the benefit of the author observing any operational aspect of the U.S. Congress. Wilson later became a regular contributor to the Political Science Quarterly.
Bill Clinton
Bill Clinton attended Oxford on a Rhodes Scholarship, where he studied economics, political science and philosophy. After attending Oxford, Clinton attended Yale Law School and earned a Juris Doctor (J.D.) degree in 1973. It was at Yale in 1971 where he met fellow law student Hillary Rodham, who was a year ahead of him. They were married on October 11, 1975. After graduating from Yale Law School, Clinton returned to Arkansas and became a law professor at the University of Arkansas. While teaching law, in 1974 he ran unsuccessfully for the House of Representatives, running in a conservative district against an incumbent Republican. He lost by only a 52 percent to 48 percent margin. Clinton continued to teach law until 1976 when he ran for and was elected as Arkansas Attorney General.
Barack Obama
Barack Obama began Harvard Law School in the fall of 1988, where he was chosen as an editor of the Harvard Law Review at the end of his first year, president of the journal in his second year, and research assistant to the constitutional scholar Laurence Tribe for two years. During his summers, he returned to Chicago, where he worked as an associate at the law firms of Sidley Austin in 1989 and Hopkins & Sutter in 1990. He graduated with a J.D. magna cum laude from Harvard in 1991, and returned to Chicago. In 1991, Obama accepted a two-year position as Visiting Law and Government Fellow at the University of Chicago Law School. He taught constitutional law at the University of Chicago Law School for twelve years, first as a Lecturer from 1992 to 1996, and then as a Senior Lecturer from 1996 to 2004.

I don't think I've forgotten any of the other presidents who taught law (but I have this nagging feeling that I have). If you can think of anyone I've missed, please let me know in a comment or tweet.