Scandalous officiating. A blatant penalty and 2 perfectly good goals disallowed.
Offside should be measured by the most forward part of the players' feet. The rule is surely about standing in an offside position, and where your feet are defines where you are standing, not an arm, an arse, or head or shoulder.