Also called a house, a dwelling is where you can sleep, put your gold into the coffers, chat with friends and so on.
You can give out a limited number of keys to other players to share your coffers with them and offer them a place to stay.
Dwellings are accessed in the "Residential Quarter" of every country. You can buy or build dwellings there.
To buy or build a castle you must have 50 Final Tests (Taicho). Note that castles can only be built or bought in special places.