The "Laws of the Game" state that a player is guilty of an offside violation if two conditions are met: 1) He is in an offside position when the ball is last touched by a player on his team, and, 2 "He is involved in active play by [either] interfering with play, interfering with an opponent, or gaining an advantage by being in that position."
Now back to the two goals I linked above. In the first, Bendtner is in an offside position when the ball is initially crossed to Krohn-Deli. He is clearly not in an offside position when Krohn-Deli heads the ball back across to him. On the initial cross, he is neither interfering with play, nor interfering with an opponent. But surely he gains an advantage by being in an offside position at that moment. If he weren't in an offside position, he would be closer to both Pepe and Bruno Alves, who could more easily track him and mark him on the following play. Now it turns out that both Bruno Alves and Pepe are giant ball-watchers, and simply turned their heads and watched as the play unfolded, in this case. However, even if they were decent defenders, they wouldn't have been able to get back mark Bendtner and prevent the goal, precisely because Bendtner was already closer to the goal. Thus, according to the clear and obvious meaning of the words in the offside rule, Bendtner is guilty of offside.
But wait! Since the offside rule is so complicated, FIFA appends a whole section to the "Laws of the Game" clarifying its interpretation. As you can see if you care to look at page 109-110 (that's right) in this PDF, you'll see that precisely this type of play, is deemed "not an offside offence." In fact, the phrase "gaining an advantage by being in that position" is furthermore defined to encompass only two specific situations, namely being an offside position when a teammate makes an effort on goal that rebounds off the goalpost or the goalkeeper.