The number of electrons determine the amount of covalent bonds that can be shared between two elements. However, the bonds can only form in the outer most shell of the element. If you had 18 electrons in the third outer shell, then that element could have 18 covalent bonds.