Creatures in the fog are blinded no matter where they look
Heavily obscured means
A heavily obscured area—such as Darkness, opaque fog, or dense foliage—blocks vision entirely. A creature effectively suffers from the Blinded condition (see Conditions ) when trying to see something in that area.
If a creature is standing at the outer edge of the fog area, but still in the fog, the fog in front of its eyes blocks vision entirely. Unless it has some way around that like blindsight, with vision blocked entirely, it is effectively blinded, and suffers the blinded condition. The entire text of heavily obscured is applicable rules text, not only the last sentence about seeing something in the area, that uses more formal rules terms.
The blinded condition reads
- A blinded creature can’t see and automatically fails any ability check that requires sight.
- Attack rolls against the creature have advantage, and the creature’s Attack rolls have disadvantage
So, if your vision is blocked entirely, as applies to any creature within the fog, it is blinded in general, not only if it is trying to see something else that is in the fog.
That last sentence was actually reworded in an errata from an earlier writing of heavily obscured which said that "you are effectively blinded when you try to see something obscured by it", which was confusing people. It aims to clarify that even though you are not blinded forever if you are outside the area looking in, you cannot see anything in it, as if you had the blinded condition - but of course you can see other things that are outside. If you are in the area, you always have the blinded condition, as your vision is entirely blocked, and having no vision is the very defintion of being blind.
The creature would not get advantage to attack someone standing outside the fog.