In short, if there is a leak at the TOP of the liquid dip tube, gas will come into the beer line through the hole, along with the liquid, since the leak location is not submerged. Then you get insane amounts of foaming.
The easy way to check this is to tip the keg over so that the entire liquid dip tube is submerged, and then see if it still foams a lot on the pour.
The fix is to sanitize you hands, de-pressurize the keg, disassemble the liquid-out post and tube, and re-assemble it correctly with new, lubed, O-ring(s). I went through this with my first keg ever, which I got used -- the O-ring was on the wrong side of the dip tube. the tube needs to stick through the O-ring: