A duplex is individually owned but has two residential units, typically side by side, with separate entrances. A townhouse is a single residential unit, individually owned, which typically sits side by side with identical or similar units. Both types of dwellings often have common foundations and walls between units.