Agree with the above posters regarding GI parasites or even viral gastroenteritis. Only the vet can say. If the blood is bright red (as opposed to darker, which reflects partially digested blood from the upper GI tract), you can examine your pup for anal fissures, which can be caused by straining. Apart from the blood, has the consistency of the stools changed? Has he seemed more tired or anything like that? Wish you the best