Assigning Re and Si face for Carboxylic group
The carbonyl oxygen gets higher priority because it has a real oxygen bonded via $\sigma$ bond and also the double bond, but we count that as the oxygen bonding back to the carbon. We don't treat it like a real carbon; it's a "ghost" or "phantom" carbon with nothing attached to it. This carbon counts as a carbon but is lower priority than any other real carbon. That means that -O-(C) outranks -O-H.