To make a house you need a walls, a light source, a table and a chair.
Then NPC will move inside.
If you want to know if the house you made is suitable for a NPC go in the crafting menu. Click the ''housing'' icon at the right below the minimap, Click the ? button then click your house.