Characterizing all graphs with 2-exceptional edges