The correct answer is TWICE.
Barack Obama served as Illinion state-senator during three terms, between 1997 to 2004 and therefore this means that he was reelected twice. When his precedessor, Alice Palmer announced her desire to run for the US House of Representatives, Obama joined the race for the Senate's 13th district seat.
While in office, in the elections of 2000 he unsucessfully attempted the run for the US House of Representatives. Finally, he was able to leave in 2004.