The bartender uses a simple logic: If the numbers of upsides/downsides are odd, then invert 1 glass otherwise invert 2 glasses

So if the configuration is 1-3 or 3-1 up-down, he inverts one glass

If the configuration is 2-2 he inverts 2 glasses

The glasses he selects to invert is either G1 (for odd configuration) or G1 and G2 (for even configuration) after each rotation

G1

G4 G2

G3

By doing so, in 1-3 configuration, he will either make the config 4-0 or 2-2 after the first rotation with a probability of 25% and 75% respectively.

Then each time, he inverts the glasses when they are in an even configuration, the new configuration would be 4-0; or remain 2-2 (with the new configuration as u-u-d-d or u-d-u-d). He has 1/2 probability of making it a 4-0 configuration if the previous configuration was uudd and 0 probability if it was udud.

Effectively, after every alternate inversion of even glasses, he will have 50% probability of making it 4-0.