This is just what I abserved in our neighborhood.
These concept can be different from area to area.
Condos can be multi-storied. A family lives above another family. Don’t have own backyard. Park in the common parking lot.
Townhouses can be 2-storied but both floors belong to one family and are connected by stairs. You don’t have another family living above you, but you have another family right the other side of your wall. Townhouses have smaller (than detached houses) backyard and often own garages.
Both are forms of “attached house” compared to “detached family houses”.
Apartment in my area means condo complex for RENTAL. A manager or officer usually manages them.
Apartment in Northeastern area includes individual floors of detached houses each occupied by different tenants, also. These northeastern type apartment would be the prototype of modern apartment complex, I think.
Anyway, apartment is meant for rental, condo is for sales. But of course you can buy a condo and rent it to somebody else. You, the landlord will manage it.