Hi!
Since there is blood which you can see, it is coming from the lower gut. The possible causes are hemorrhoids, anal fissures, anal infection, rectal polyps, colon polyps, diverticulosis (outpouchings from the bowel wall), inflammatory bowel disease (IBS, Crohn's, Celiac, ulcerative colitis), or dysentery.
In hemorrhoids the blood falls after the stool. In fissures it lines the stools. In all other problems the blood is mixed with stools.