He excels ____ mathematics but struggles ____ history.
Explanation
"Excels in mathematics" is correct because "excel" is followed by "in" when referring to a subject or skill."Struggles with history" is correct because "struggle" is followed by "with" when referring to difficulties with something.