Hello and welcome to pet lovers!
Your kitty may be peeing on the furniture because he has a urinary tract infection. (UTI) Stress can cause infection in cats (it also causes kidney failure) and he certainly has had a lot of stress so I recommend a trip to the vet very soon for kitty.
As for training the dog, we have some very knowledgeable dog training people here who will be along to help with that, but do please take kitty to the vet.
Males can block suddenly and quickly when they have infections, and once blocked, they die within 24 hours.
I recommend blood work along with the urinalysis to make sure his kidneys are doing okay.