Games played in the NHL is one part of the equation--the other part is the age when a player first signed a professional contract. I'm pretty sure McDonagh signed after his 21st birthday, which means he was waiver eligible (21 year old only get 80 games before becoming waiver eligible).
The age of the players signing his ELC determines waiver eligibility. Hagelin has been a 1 year pro and he is not waiver exempt. He signed his ELC as a 22 year old. There are players who have played 2 NHL seasons and they were assigned to the AHL last week because they were waiver exempt. Those players signed their ELC at 18.