I believe as long as you are in a life threatening situation and the intruder has deadly weapons you are free to do so.
Home Invasion is a serious offense and I am pretty sure as soon as they get in to your house by trespassing you are free to just spray the bottle empty.
However I am not sure, but if you put a "No Trespassing" sign on your front door and they break in, you are free to pepper spray, because they are trespassing and that sign is a well enough warning.