How Does a Court Decide Who Gets Custody of a Child?