To unlock the Ghost Family trophy in The Sims 4, you will need to have a family of eight playable ghosts.
You can combine this trophy with the trophy below:
Set up a new family of eight Sims, and lock seven of them in an empty room until they eventually die. Have your 8th Sim befriend the ghost Sims as they appear until you have the option to ask them to move in.
Once all 7 ghost Sims have moved in, lock the 8th (alive) Sim in a room until they die, and then befriend their ghost with your now playable Ghosts until you can ask them to move in as well.
You will also unlock the trophy below once whilst you unlock this trophy: