I have no idea how to make a house on Terraria without a NPC moving in.
2 Answers
To prevent NPCs from moving in the house, there are two ways.
Make the house unsuitable
The first is to simply not equip the house with the furniture necessary for a NPC to move in. It should be as easy as building no table or chair and they won't be able to move in, because it is not suitable. You can check this with the question mark on the right side of your inventory, when you are in the NPC tab.
Build other houses
The second way would be to build enough other small houses for all the NPCs to move in and assign them to those houses. After that they should stay there and won't try moving in your other house.
To prevent them from entering the house normally, there is no way other than making it inaccessible for them i.e. floating.
Yup.... This is he/she mean that there ways to not move in your house:
Build an Irregular houses
Don't place a things have in requirement for having NPC like chair,table,torches and rectangular houses.
Be prepared
Build another houses before you fight againts bosses or before NPC's arrival (You noticed that if theres a message like "Andrew would like a settle down)....