Did you select all of column G and then applied the formula in the conditional Formatting window...as I wrote it?

I tested it and it does work for both conditions.