Generally speaking, each atom will form as many bonds as are necessary to completely fill its outermost electron shell. For example, oxygen is in group VI, and it has six valence electrons, but there is space for eight electrons in its valence shell.