Are you asking how to determine formal charge on an ion or a molecule? The question has been covered before.
A neutral oxygen atom has 8 protons, 8 fundamental POSITIVE nuclear charges. To balance this charge there must be 8 corresponding NEGATIVE particles, or 8 electrons. When we write our formula of water,
By this criterion, oxygen gets 2 electrons, and there are 2 oxygen-based lone pairs (
Can you tell me the charge distribution in nitrate anion,