In this case, he really wasn't onside a millisecond earlier.
I agree with the rule to not raise the flag if it's tight and there's a clear goal-scoring opportunity. There needs to be a bit of common sense applied though, when it's so obviously offside.
He's so far offside though. You could even see him hesitate when he goes for the ball knowing he's offside. This is definitely one of those cases when the flag should have gone up immediately.