I think these general rules work:
- If there is an $\ce{sp^3}$ hybridized carbon (or nitrogen), the molecular is NOT planar.
2) If there are no $\ce{sp^3}$ hybridized carbons (or nitrogens), and there is only one $\ce{sp^2}$ hybridized atom (carbon or nitrogen), it will be planar.
3) If there are no $\ce{sp^3}$ hybridized atoms, and there are 2 $\ce{sp^2}$ hybridized atoms (carbon or nitrogen) that are separated by an even number of double bonds and no single bonds, then the molecule will not be planar.
So a general simple rule is that:
the molecule will not be planar if there is an $\ce{sp^3}$ hybridized carbon (or nitrogen) atom or two $\ce{sp^2}$ hybridized atoms of carbon/nitrogen which are separated by an even number of double bonds and no single bonds. Otherwise, its structure allows it to be planar.
Even though the molecule will have a structure that allows for it to exist in a planar conformation, there may be some/many that do not persist in a planar conformation due to steric effects, or complex three dimensional geometries.
In the problems you listed above, using this rule:
Not planar because there are no $\ce{sp^3}$ and the two $\ce{sp^2}$s are separated by an even number of double bonds.
Planar because there are two $\ce{sp^2}$s but they are separated by an odd number of double bonds (3) (and no single bonds)
Planar because there are no $\ce{sp^3}$s and only 1 $\ce{sp^2}$s that make 3 or more bonds (C or N). The orbital geometry is NOT planar because the $\ce{sp^2}$ oxygen is separated from the $\ce{sp^2}$ carbon by an even number of double bonds.
Planar because 2 $\ce{sp^2}$s are separated by an odd number (1) of double bonds (and no single bonds)