What does oxygen need to do in order to to achieve a stable electron configuration?

Oxygen atoms need to share or gain two electrons in order to achieve a stable electron configuration.