FAMILY CODE SECTION 3010-3011
3010. (a) The mother of an unemancipated minor child and the father, if presumed to be the father under Section 7611, are equally entitled to the custody of the child.
(b) If one parent is dead, is unable or refuses to take custody, or has abandoned the child, the other parent is entitled to custody of the child.
3011. In making a determination of the best interest of the child in a proceeding described in Section 3021, the court shall, among any other factors it finds relevant, consider all of the following:
(a) The health, safety, and welfare of the child.
(b) Any history of abuse by one parent or any other person seeking custody against any of the following:
(1) Any child to whom he or she is related by blood or affinity or with whom he or she has had a care taking relationship, no matter how temporary.
(2) The other parent.
(3) A parent, current spouse, or cohabitant, of the parent or person seeking custody, or a person with whom the parent or person seeking custody has a dating or engagement relationship. As a prerequisite to the consideration of allegations of abuse, the court may require substantial independent corroboration, including, but not limited to, written reports by law enforcement agencies, child protective services or other social welfare agencies, courts, medical facilities, or other public agencies or private nonprofit organizations providing services to victims of sexual assault or domestic violence. As used in this subdivision, "abuse against a child" means "child abuse" as defined in Section 11165.6 of the Penal Code and abuse against any of the other persons described in paragraph (2) or (3) means "abuse" as defined in Section 6203 of this code.
(c) The nature and amount of contact with both parents, except as provided in Section 3046.
(d) The habitual or continual illegal use of controlled substances or habitual or continual abuse of alcohol by either parent. Before considering these allegations, the court may first require independent corroboration, including, but not limited to, written reports from law enforcement agencies, courts, probation departments, social welfare agencies, medical facilities, rehabilitation facilities, or other public agencies or nonprofit organizations providing drug and alcohol abuse services. As used in this subdivision, "controlled substances" has the same meaning as defined in the California Uniform Controlled Substances Act, Division 10 (commencing with Section 11000) of the Health and Safety Code.
(e) (1) Where allegations about a parent pursuant to subdivision (b) or (d) have been brought to the attention of the court in the current proceeding, and the court makes an order for sole or joint custody to that parent, the court shall state its reasons in writing or on the record. In these circumstances, the court shall ensure that any order regarding custody or visitation is specific as to time, day, place, and manner of transfer of the child as set forth in subdivision (b) of Section 6323.
(2) The provisions of this subdivision shall not apply if the parties stipulate in writing or on the record regarding custody or visitation.