First, I need to break this question down into:
1. Carry piece
2. Home Defence - or other
With regard to a carry piece, my biggest concern is going to be size. My next biggest concern is that it fire at least 9mm, .40 or .45. If the round count is going to be between 6 rounds and 8 rounds, then I'm going for the .45 with 6 rounds. One or two more rounds of 9mm is not what I need.
In a Home Defense gun, I opt for more rounds. Shots could be longer distance than with a carry piece, and there is a better likelihood that there could be multiple attackers. So, in a home defense gun, I'd really like to have as close to 20 rounds as I can squeeze into a reliable magazine.
FWIW, I do not like shotguns for home defense - this is just my preference. I prefer a handguns because 1) its small and can be stashed where I can access it easily - shotgun generally has to be kept out in the open; 2) I'm more comfortable clearing my house with a handgun; 3) The "cha-chink" of a shotgun doesn't impress me, and I'm sure my wife will think it makes me out to be some kind of commando; 4) shotgun requires 2 hands....whatever the reason, a shotgun isn't for me.