When different things belong to different owners, an apostrophe (') and an -s are added to each noun in the sentence, depending on whether the noun is singular or plural.
When the same thing belongs to different owners, an apostrophe (') and an -s are added only to the last noun.