There should be two players in front of the last offensive player for that player to be onside. So generally you have one defender and the goalie. In this case since the goalie was ahead of Tevez there was only one player ahead of him, hence he was offside.