Yes, it is all quite confusing, so it will be important you read the deeding information for a townhouse and condo as "appearances" don't count.
Townhouse = Deeded ownership of land and building, plus an undivided deeded interest in common areas/elements --- Unless otherwise noted!
Condo = Ownership of space between ceiling and floor, and deeded undivided interest in "all" land and buildings in the complex/community.
Coop = Operates as a corporation (hence the name,) which provides "shares" of interests in the land and building.
Clear as mud? Yes, I thought so! Consult a real estate professional in your area to provide all purchase and deeding information.