I would say:
ホストファミリーの皆さんは、私にとても良くしてくださいました or とてもやさしくしてくださいました。
(It's for when you talk to someone about your stay.)
If you want to know how to thank them in a polite way, I would say:
大変お世話になりました。皆さんに良くしていただき (or 優しくしていただき)、感謝しています。
In my opinion, it isn't needed saying "while I lived with them" because "host family" means "they live(d) you".
However, there are other ways of saying your sentence in Japanese. I hope other people answer with their version. I hope this helps you.