Mesh deform on bone move in pose mode

So I’m new to blender, modelling and animation but I managed to run into a few tutorials, and I attempted to do some rigging of my model by myself, but once the rigging was done I tested it in pose mode and this happened;
[video]https://i.gyazo.com/8379ce91e9550678edc1816408811baf.gif[/video]
[video]https://i.gyazo.com/9635d62d3665f08f2cfc73102fd176e5.gif[/video]
[video]https://i.gyazo.com/faf75758fb722b68179cec8611517639.gif[/video]
[video]https://i.gyazo.com/5b94c82ecca7f24c2484b12212b68f6a.gif[/video]

I have no idea what I’ve done wrong or how to fix it, if anyone could help me and/or tell me what to do in the future to avoid this I’d be really grateful.
Sorry if this is in the wrong forum or if I’m just so bad it can’t be fixed.

TestRig.blend (675 KB)