What's the difference between townhouses, and country house? what's the difference between country,downtown, village, town And the last question is why "in" only goes at the first sentence: I live in a mansion - I live on a ranch
These terms are often very particular to countries and to eras of time. Imagine being a reader absorbed in a Jane Austin novel, or a Sherlock Holmes Story, or a Raymond Chandler detective adventure. Further, being a reader who is familiar with the terminologies of the relevant times and places. Then a simple one or two word phrase such as "country house" or "cottage" paints a picture not only of the building itself but also the surroundings and the (at least for British readers of British stories) the social class of the people living there.
For example: Jane Austen novel, early 1800s, Country House: residence of a wealthy or aristocratic family (Mr Darcy), large house, many rooms, extensive grounds, lake (for Mr Darcy to emerge from), butler, cooks, maids, servants. See Wikipedia. Such a family may well also have a Town House for use when they return to London.
That concept of Town House, would be less common in a more modern setting where it may well simply imply a small-footprint terraced house in an urban setting (be it town or city) - land is expensive so keep area small, build up.
To understand the set of implications of even simple words such as cottage, brownstone, mock-tudor semi, condo, or almshouse requires quite extensive background knowledge. My general approach is to look up in a dictionary to get a feel for the idea and then keep reading, often additional description comes later.
It is possible to have townhouses in the country, usually in a village in the country.
The distinction between
are determined by the number of people living there.
You can live
in a townhouse
in a country house
in a ranch house
in an apartment
in a good neighbourhood
and you can live
on a ranch
on a coastline
on a mountain
on a boat