At one time all dogs could voluntarily express their anal glands. Most dogs have lost the ability to do this voluntarily...they are expressed when they have bowel movements. These are glands located on either side of his rectum and were used to mark their terrority. The result is
very smelly, brownish goo (that's a real technical term.
)...but it could be mistaken as diarrhea. I have read of other cases here...where some yorkies could still apparently release their glands voluntarily and actually had done this in their owner's laps.
I would attempt to collect this fluid and take to the vet. Perhaps they can determine if it's fluid from his glands or actually feces.