Sometimes a judge will grant legal custody to a nonparent, usually a relative or stepparent who has been living with your child and providing day-to-day care on a regular basis. Judges tend to award custody to third parties only if the judge finds that there is a good reason not to give custody to the natural parents (for example, the parents are unfit).
A nonparent can request custody in your divorce case, any other court case involving the child’s custody (such as guardianship, or where juvenile court or the State Office for Services to Children and Families is involved), or in a separate lawsuit. These are sometimes called ‘psychological parent’ cases. Usually, a judge cannot award custody to a nonparent unless that person has filed legal papers that ask for custody.