There are two kinds of custody: legal custody and physical custody. Custody battles most often arise in a divorce or separation, requiring a court’s determination of which parent, relative or other adult should have physical and/or legal control and responsibility for a minor (child) under 18. When both parents share custody of a child after a divorce it is called joint custody. Sole custody is both legal and physical custody by one parent. Physical custody designates where the child will actually live, whereas legal custody gives the custodial person(s) the right to make decisions for the child’s welfare. In sole custody arrangements, one parent has custody and is allowed to make all the important decisions in a child’s life, and are not required, but may consult their ex-spouse. Child custody can be decided by a local court in a divorce or if a child, relative, close friend or state agency questions whether one or both parents is unfit, absent, dead, in prison or dangerous to the child’s well-being. In such cases custody can be awarded to a grandparent or other relative, a foster parent or an orphanage or other organization or institution. In some jurisdictions, if a child is old enough, their preferences are taken into consideration. This term is no longer commonly used in Illinois.
The basic consideration on custody matters is supposed to be the best interests of the child or children. Mental anguish suffered by the child due to visitation or lack thereof is one factor that may be considered in determining a child’s best interest. In most cases the non-custodial parent is given visitation rights, which may include weekends, parts of vacations and other occasions. The custody order may be modified if circumstances warrant.
( Source: https://en.wikipedia.org/wiki/Sole_custody )