A man is wearing a neon yellow vest while leaning over a roof and another man is standing behind him.
A guy is looking over the side of a building with someone else.
Man and guy are used to specify the same male human. Leaning over is the method by which the first man is looking over the side. Another man is indicative of the second person identified as someone else.
A 'guy' can be used as a synonym for 'man', also 'looking over the side of a building with someone else' is a rephrasing of 'leaning over a roof and another man is standing behind him'.
Looking over the side of a building requires leaning.