
 welcome to YT! 
When a dog rubs it's bum it usually means their anal glands need to be expressed.  Some dogs do this on their own and some need help from a vet or groomer (i don't do it myself).  Has he been to the vet since you had him? 
Did he only throw up once?  Was it food? 
I think most Yorkies are escape artists!

  I bought this for my dogs: 
 Amazon.com: Pink Pet Tent Exercise Pen Playpen...
Amazon.com: Pink Pet Tent Exercise Pen Playpen... 
It's collapsible and portable.  It a top also so that your pup can't escape.   
What's his name?  Photos?