THE DECISION
The goal is awarded and the defender is cautioned (yellow card) for deliberately leaving the field without permission. The attacker was not in an offside position because, according to Law 11, a defending player who leaves the field is considered to be on the goal line until the next stoppage in play or until the defending team plays the ball towards the halfway line and it is outside the penalty area.
Read official Law 11 ↗