Hi and welcome! It might be in his diet. Sweet veggies and anything with sugar can upset a tummy upset. As for the blood, is it bright red, like maybe an irritation in the lining of the large intestine? You might want to take him back to just a basic diet of dried kibble, (Oxbow?) some processed cereals and pumpkin and/or sunflower seeds? Try that for a few days, see if you can isolate the food causing the upset. Rats don't do well with digestive issues, they can't throw up, and gas makes them miserable 