What does a mayor have to do to become a mayor?

he gets elected