As the first answer said, a townhouse is a physical description, and condo is a legal description that defines the common ownership of the land, buildings, and common areas.
In SoCal, almost all townhomes are condos. Townhomes have no other unit above or below them, but are often attached on the sides, although they don't have to be.
The other part that can be so confusing is that there are also DETACHED Condos (that look like single family homes), and ATTACHED Single Family Homes (that look like townhomes!)
The legal description of the property will tell you exactly what it is!