Condos (Condominiums) and Townhouses (or townhomes) are broadly categorized as forms of housing structures, both terms being widely used in North America.
A condominium is a housing structure that is a part of a bigger unit or building and the owner of the condo owns the interiors independently and the other services in the building jointly with other condo owners. A townhouse is a style of housing where a row of identical houses share walls. Here the owner owns the whole unit as such. They both may come under a structure of housing tenure or other legal agreements. (These definitions apply in most cases but there are variations. See comments for examples.)
edit Legal status
Condominium is a legal term in the United States and most areas of Canada. The creation, sale and management of Condos is governed by specific statutes in the US while there are no statutes governing ownership of Townhouses. Different states have different statutes governing condominiums. Townhouses are simply governed by the same laws that apply to single family houses.
A condominium consists of multi-unit dwellings (i.e., an apartment or a development) where each unit is individually owned and the common areas, such as hallways and recreational facilities, are jointly owned (usually as "tenants in common") by all the unit owners in the building. In a townhouse, the owner owns the whole unit, the exterior surfaces such as deck or yard and the land on which it is built.
edit Common areas
Every housing structure has common structures such as Recreational parks, walking areas, parking lots etc. Condo owners share ownership of the common areas with other owners, while common areas in townhouse developments are usually owned by the homeowners' association for the benefit and use of unit owners.
edit Home Owners Association
In all condo and townhouse projects, the "common areas" of the property (open spaces, recreation areas, tennis courts, etc.) must be managed and maintained for the benefit of unit owners. To accomplish this, a homeowners' association is usually established when the project is created. The association has an elected executive board that manages the association and performs such tasks as enforcing the rules and regulations and collecting the homeowners' dues. The association is also responsible for day to day maintenance of facilities such as parks or lawns and may charge the condo and townhouse owners according to their contracts. They are generally called a Home owners association (HOA) for Townhouses and Condominium Associations for condos.
edit Land ownership
In a condo, the owner does not own the piece of land on which the housing structure is created since it isn't an independent structure and is just one part of the building in which the condo is housed. In a townhouse, the owner owns the piece of land, its interiors and its exteriors, on which the townhouse is built since it is independent of other townhouses in the housing community. Detached condos may have rules similar to townhomes.
In a townhouse, the typical structure consists of identical houses built one after the other. They may have straight walls in most of the cases and may also be multi storied. A condo, is just one part of a building and may not be similar to the next condo in that building. While a townhouse starts from the ground floor, a condo may or may not start from the ground floor. A condo may be situated on any floor of the building. While condos may not have any exterior spaces that they own individually, townhouses owners may have small decks or yards of their own depending on the structure they purchase.
Condominiums usually turn out to be cheaper than townhouses. In general, the same square footage will cost less in a condo setting than it will in a single family home or townhouse, mainly due to the cost of land. When you buy a townhome, you also pay for the land where only one structure is built, thus increasing the cost. In a condo, the owner doesn't own the land and in that same space, many more condos can be built making them cheaper.
While the exteriors of a condo or a townhouse are maintained by the home owners association, it is upto the owner to maintain the interiors. This may also depend on the agreement of the homeowners' association. Generally, a townhouse owner has more authority is changing the interiors of the land and other structural changes as the land is also owned by them while the power of a condo owner is limited.
edit Safety and Privacy
Both have their own pros and cons when it comes to safety and privacy. While in a townhouse, there may be houses on either side of one's house, in a condo, there may condos on all sides thereby reducing the privacy. As regards to safety, both offer security but a condo may be safer as there are many condos close to each other while in a townhouse there are fewer houses next to each other.