Three astronauts flew to the Moon more than once: Jim Lovell, John Young and Eugene Cernan.
Lovell first reached the Moon on Apollo 8, the first crewed lunar-orbit mission, and returned on Apollo 13. Apollo 13’s landing was aborted after an oxygen-tank explosion, but Lovell and his crewmates still traveled around the Moon before returning to Earth. Lovell is therefore the only person to visit the Moon’s vicinity twice without landing.
Young flew around the Moon as Apollo 10’s command-module pilot in 1969, then commanded Apollo 16 in 1972 and walked on the lunar surface. Cernan also first orbited the Moon on Apollo 10, serving as Lunar Module pilot, and later commanded Apollo 17, the final Apollo lunar-landing mission.
The wording matters: the answer is three, not the number of astronauts who landed twice. No Apollo astronaut walked on the Moon on two separate missions. The three counted here are the people who traveled to the Moon’s vicinity more than once, including lunar orbit or Apollo 13’s free-return flight.