Both phrases use hyphens correctly to form a compound
“phrasal” adjective, family-owned-and-operated:
... family-owned-and-operated business ...
The business was family-owned-and-operated.
Neither phrase needs hyphens, however, in an unambiguous context:
Smith's Roadhouse was a family owned and operated business.
The business was family owned and operated.
Many writers omit unnecessary hyphens for the sake of neatness.
In comparison, the hyphens should indeed be included here:
The business was family owned and operated for years.
Was the business family-owned during all the years that it was in operation?
EL&U – When is it necessary to use a hyphen in
writing a compound word?
Get It Write – Compound Words:
When to Hyphenate