In the second case, it says "if the sun has risen on him", and you kill the intruder, you are guilty of his bloodshed. The understanding is that in daytime, there is light, and you can discern the intentions of the home invader. The crime in question here is theft ("if thethief"...