You will look at its number lets say if you had H2O which is two hydrogen and one oxygen. The two hydrogen is combined with oxygen sharing it's electrons making it being covalent bonding. You need 8 valence electrons that meaning full outershell. Hydrogen only has one in it outershell oxygen has 6 that's what can make a compound