The word custody means to protect or have responsibility for. In this case, custody is the legal right to take care of someone or something. It is usually used when talking about children, however, it can also be used to talk about things.
Ex: The court granted custody to the children's mother. Their father had not been part of their lives for a long time, so it made sense for them to live with her.
Ex: The bank's vault gave safe custody to my mother's antique ring. It was a family heirloom, and I wanted it protected.
Custody can also refer to someone under police protection or a person being kept in prison. Law enforcement has responsibility for the person, usually due to a criminal act.
Ex: The teenager was taken into custody by a policeman when he was caught driving without a license. He was later released to his parents.
Ex: When the thief was caught he was immediately put into custody. He will spend several years in jail.
Keep safe means to protect something or someone from harm. It implies that there is reason to fear harm or loss. Often, the words in the phrase are separated by an object.
Ex: The babysitter promised that she would keep Jimmy safe. His parents were nervous because he'd never been swimming.
Ex: I was nervous about leaving my diamond earrings in the ship's safety deposit box, but the captain assured me that he would keep them safe.
Sometimes keep safe is used to talk about a secret. It means that you won't tell anyone the secret or give too much information about it.
Ex: I will make sure that your secret is kept safe. I will not tell anyone that you are pregnant until you are ready for people to know.
Ex: Can you keep my secret safe? I do not want anyone to find out that I am only sixteen and cannot drive.