Following the shell distribution oxygen has a 2.6. configuration and an electronic configuration of .This means that oxygen has 6 valence electrons that can be used in chemical reactions . In-order to obey the octet rule it has to gain 2 more electrons to have a 2.8 shell configuration.An electron gain is usually denoted by a negative sign whereas a loss is denoted by a positive sign.Hence the -2 charge on the ion it forms.