phase margin and gain margin
Both margins are used to measure how stable the system is.
For phase margin it is the phase difference to 180 degree when the gain is 1
for gain margin, it is the gain when the phase shift reach 180 degree.
so it is two faces of the same coin.
just rememebr when you have 180 degree phase shift, if your loop gain is >= 1, then you have oscillation. That is why you want either one of two cases: 1. when gain is 1, you have certain phase margin; 2. when the phase shift is 180, you want the loop gain less than 1.
you also should note the difference between open loop gain, close loop gain and loop gain.