Your post made me smile my son has a JRT bitch, and she does all three of those things exactly how your does.....and she is 6 years old. I think with Pappi it's 1) don't like being separated from my son 2) well if it stands still 'hump it' 3) so excited 'to see you' Best of luck, my son is still trying (Pappi is spayed by the way)
dogs don`t do things out of spite. Ignore this person. It sounds like stress - for whatever reason (separation anxiety, noises outside etc). What do you do when you leave / come back? If you make any sort of fuss, it is reinforcing his behaviour. For instance - he now knows that if he is shut in the bathroom he is going to be left alone for an unspecified time and when a person comes back in they may well be cross. That is pretty terrifying for a small dog. I would, as suggested, go back to basics - lead training, socialisation etc to build up his confidence. For the going out: Several times during the day just walk out of your front door (don`t say anything to the dog), wait a minute then return. Again, don`t even look at the dog. Continue with this, building up the time gradually. When he`s calm, increase the time. For now don`t shut the dog up - he was probably punished this way in his previous home.
Wish him well for Monday - and ask the vet how long before all the hormones quiet down and you can expect to see a change?
I think you should be aware that castration may not solve his territory marking problem. My terrier was castrated at about 6 months, and will occasionally mark inside, not something he did before but he was probably too young. He does it whenever new things such as dog beds come into the house, which is why we use waterproof (piddleproof) dog beds. Also it can take months for there to be any behaviour changes. I would say in my terriers case it has made him infertile and nothing else.