I would recommend a pistol that you are most familiar with, and can operate in the dark, under great stress, when you have been awakened from a deep sleep, without having to think much about how it works. I'm not suggesting grabbing a gun when you are half asleep, what I am suggesting is that you choose something you have so much familiarity with that you can operate it under the worst possible conditions. A caliber of 9mm or greater would be great, but if the gun you are the most familiar with is a 9X18 makarov, then I would go with that. Magazine capacity, and whether anyone else in the house (wife/girlfriend) would need to operate the pistol is also a consideration.
For home defense, it would also be highly recommended that the firearm also have a light, or that you practice various flashlight techniques (Harries/Chapman/FBI are worth practicing) in conjunction with the pistol.
In addition to the firearm, it would be recommended that you walk around your house during the day time and take a look at places from where you might shoot, and consider what lies beyond any direction in which you might be shooting. Doing these things BEFORE an incident occurs will help you greatly. Think beyond just the firearm, consider what you would do when you call the police, after you call the police, legal rights, what you would or wouldn't tell the police. It is highly recommended that you also study use of force laws, and police report writing on use of force so you know what they might consider or be looking for when they question you. It is not generally recommended that you talk with the police without an attorney present.
The firearm is just one of a great many considerations. Think beyond just the firearm or how you would shoot it. If you are ever unfortunate enough to have to shoot in self defense, the things you consider BEFORE any incident will help you out immensely.