Characterization of knot complements in the 4-sphere