Lebanon has elected a new U.S.-backed president after more than two years of gridlock in Parliament and 12 previous attempts failed.