What are requirements of having custody of a child?

Having a roof over your head, a job with steady income and the ability to nurture the child all make sense and in a court of law, may hold some validity.