Read my article on Housetraining the Urine-Marking male dog at the link with my signature below. The title will be in alphabetical order in the table of contents, and there is no fee or even registration required at this site. It's made available to the public by the Veterinary Information Network.
I would seriously consider having him professionally groomed at least once, to take care of that mess. Tell them to clip rather put him through excessive combing of tangles, and so that you can develop a daily routine of combing him out without his fur being so long while you both get into the habit.
Later on you can decide how long to keep his coat, but for now you may need to have it just clipped down for a fresh start. If the weather is cold, he might benefit from a simple coat or sweater at times, just to make sure he doesn't get chilled until the fur grows longer.
It sounds like regular trimming may be advisable, to keep the fur away from the anus. You may be able to do it yourself--I'm not familiar with the grooming typically done for a Tibetan Terrier as a routine. But every dog benefits enormously from daily grooming, physically, mentally and emotionally. It will greatly strengthen a dog's bond with you, and other things, too. It is time very well spent. Read the Grooming article at the same location as the Housetraining one. It really is astonishing the benefits a dog and owner derive from this few minutes a day.
-----
Kathy Diamond Davis, author, "Therapy Dogs: Training Your Dog to Reach Others," 2nd edition, and the free Canine Behavior Series articles at http://www.veterinarypartner.com/Content.plx?P=SRC&S=1&SourceID=47