As Jan hinted in the comments, there are multiple electron bookkeeping methods which serve different uses. We want to keep track of electrons because it gives us an idea of what type of chemical behavior might be attributable to an atom or molecule.
Octet Rule
The Octet Rule (and the related 18 electron rule for some transition metal compounds) serves to give us some idea of whether the structure proposed meets quantum mechanical requirements for valid structures. It also gives us a quick estimate of reactivity.
As an example, second period elements do not exceed the Octet Rule, so you know your structure is invalid if you have 14 electrons on an oxygen atom.
Boron compounds often do not have complete octets on boron (for example $\ce{BH3}$), but that leads to boron compounds being powerful electrophiles and having some weird bonding situations (example: diborane $\ce{B2H6}$).
Both Lewis bond theory and valence bond theory attributes all shared bonding electrons to count toward the total number of electrons for an atom.
Formal Charge
Formal charge is attempting to identify regions of high and low electron density within a structure, which help predict how some compounds react.
For formal charge, we act like each atom in a structure is an ion that has assigned to it all non-bonding electrons and half of all bonding electrons. For your structure, we can learn where the negative charge on the anion is located and where it is not.
Oxidation Number
Oxidation number is one final way to approximate electron distribution, and therefor the propensity to undergo certain kinds of reactions. Oxidation number is calculated by assuming all atoms in the structure are ionic and assigning all bonding electrons to the more electronegative atom in the pair.
Comparison
So, for your compound, the anionic oxygen would meet the octet rule, have a formal charge of 1-, and an oxidation number of -2. The neutral oxygen would meet the octet rule, have a formal charge of 0, and an oxidation number of -2. If you needed to predict where a cation would be attracted to this compound, you could choose one of the two oxygen atoms appropriately.
The two carbon atoms would both have full octets and zero formal charge, but one has an oxidation number of -4 and the other has an oxidation number of +3. In this case, if you needed to predict where a reducing agent would react with this compound, you would be able to choose one carbon atom over the other.
For monoatomic species, the three counting methods will give you the same number of electrons and the formal charge will equal the oxidation number. As an exmaple: $\ce{O^2-}$ — 8 electrons, formal charge 2-, oxidation number -2.