HOW TO DETERMINE FORMAL CHARGES
Carbon is in group 14 and has four valence electrons, thus it requires four more electrons to form an octet. It can do this by forming four covalent bonds, as each covalent bond adds one electron. The formal charge on the carbon atom is zero since each covalent bond contains two shared electrons with an electron from each atom. If the C atom only has three covalent bonds, then it will only have seven electrons (four valence plus one extra from each covalent bond) so we need to add one more electron to the C atom to complete its octet. This gives us a carbanion, e.g. [CH3]–, with one lone pair and a formal charge of –1. The same will apply for the rest of group 14.
Nitrogen, with five valance electrons, needs three covalent bonds to achieve an octet and it will then have a formal charge of zero. Like C, if it is missing one bond, it will require an extra electron and will have a formal charge of –1, e.g. amide, [NH2]–. If it has an extra bond (four bonds in total), it needs to lose an electron and so it will have a charge of +1, e.g. ammonium, [NH4]+. Similarly for other members of group 15.