Firstly, as previously stated, get a restraining order on him. Then go buy a 12 gauge shotgun/and or a 357 magnum. If he shows his face around, remind him ONCE that hes under a restraining order, After that one warning, if he doesnt want to vacate, fire a shot into the ground as a warning shot. If that doesnt dissuade him, bust a cap in his bitch ass.

EDIT: if you couldnt bring yourself to kill him, buy a .22 pistol. Thats small enough to make someone think twice before fucking with you. They sell ratshots for those that would be a nice deterrent for the first shot.