If there are exactly 2 goals scored, the bet would be a loss. So the key difference between the two bets is that the "over 2" bet has a slightly lower threshold for winning (2 goals), while the "over 2.5" bet has a higher threshold (3 goals) and therefore offers potentially higher returns.
Specifically, "Over 2" means that the sportsbook is predicting that there will be more than two total goals scored in the game. So, if you were to place a bet on the "Over 2" outcome, you would win if there are three or more goals scored in the game, and lose if there are one or fewer goals scored.