The only way to know for sure what is happening with this dog is to take him to a vet.
He is in pain (that is why he wants to bit when you try to touch), and it sounds like he has an infection (the runny puss). With Westies it is very likely that he had impacted anal glands which burst and now are infected. This would make his back hurt for sure!! It would also smell terrible.
So, get him to a vet as soon as possible and get him the help he so desperately needs!
Thank you Krista she is all better now thanks to your advice, also helped that we encouraged her to walk around instead of laying on it and putting ice packs on her leg