Does the father get custody if the mother dies?

The father would be the favored person to get legal custody if the mother had custody and died unless he was found to be unfit to have custody.