If the drainage is coming from the side of the anus, then it's probably an abscess that is draining. If the drainage is come from the anus itself, then it's probably that his anal glands are full and need to be emptied, by a vet. It's a very easy procedure, very inexpensive and doesn't take that long to do. If it's his anal glands and you don't get them emptied, they can become infected and extremely painful for the dog. Whether it's an abscess or the anal glands, he/she needs to be seen by a veterinarian.
My Chihuahua Has A Deep Hole Next To His Anus Which Is Draining Puss What Could It Be And What Can I Do About It
It could also be that one of his anal glands ruptured, either situation the dog should be seen and evaluated by a vet.
It sounds like a condition that humans can get. It could be a pilonidal abcess. this is where a hair follicle is turned around and is growing inwards into the bowel. This requires surgery as it will get worse unless checked.
Here's a thought. Try taking the poor thing to a veterinarian. I know that sounds strange but try it.