When you are legally responsible for another person, they are in your custody. Most parents have custody over their children.
The word custody brings with it the meaning of care for. When someone is in your custody, it is not just that they reside with you, it is that you are responsible for taking good care of them. If you are arrested, you will be taken into police custody. While there in jail, it is their responsibility to protect you from harm.