House

A House is a structure that meets the following criteria:
 * Has side and back walls, a floor, and a roof.
 * Has a table, a chair and a door.
 * Has a light source.
 * Is at least 12x5 blocks in size. (This needs to be confirmed.)

For setting the player spawn point by using a bed, only the first of the above seems to be required.

An NPC requires a house to spawn. For an NPC to move in, the house must also be unoccupied.