A person living together in the same house — could mean a family member, lodger, or someone residing in the same home.
夏休みに親戚の同居人が家に滞在した。
A relative who lives with them stayed at the house during summer vacation.
彼は大家の家に同居人として住んでいる。
He lives in the landlord's house as a lodger.
同居人とのルールをきちんと決めておいたほうがいい。
It's better to set clear rules with your housemates.
A housemate/flatmate/roommate — someone you share a residence with.
大学時代の同居人とは今でも親友だ。
I'm still good friends with my roommate from university days.
同居人と家賃を折半して住んでいる。
I share the rent with my housemate.