Formal charge for O2: (6 valence electrons) - (6 lone pair electrons + 1 bonds) = -1
Structure A is a better representation of CO₂ because it minimizes formal charge.
You'll notice that both structures have an atom with a formal charge of -1. - When this happens, the structure with the charge on the more electronegative atom is the better representation.
Want more practice? Make sure to check out the tips and tricks for AP Chem FRQs and this video replay about 🎥 Resonance and Formal Charges.