A Villa is a one/two-story building with an external patio and a front garden or terrace. They can be attached to another nearby villa or have at least one shared wall. Villas have a long history dating back to the Roman Empire.
A farmhouse is usually purchased as vacation homes, second homes or rental spaces. In many parts of India, farmhouses are also used for commercial purposes such as weddings, corporate events, parties, etc.
In India, a living space is termed as a flat when it's a part of a building that's itself part of a cluster of buildings. These types of localities are usually referred to as housing societies or townships.