Who gets custody of a child when the married mother dies and biological father does not have rights?

I assume this to be an out of wedlock, extra marital affair child. Her husband.