The dog has only diarrhea is not an afraidable but with the bloody substances is serious
in condition and you may give him a better treatment with the helpful of a doctor.
The diarrhea could be caused by random stomach issues and the bloody stools could be a result of straining or going so frequently. I'd suggest seeing a vet.