I guess it's 3 years by the time they are 21, and in some cases 22 also-ran as you can see a number of 22yo players are eligible to play for U21 tournaments..
in game, and in English league as I have observed, a few 22yo count as U21 while registering your team.
the point you mentioned about the 2 players being 18, and while One became HG and the other didn't, it would be because of their birth dates.
eg, A was born on 1st September 1996, & B was born on 18th June 1997, as on 1st July 2015, both of them are 18 in game, right?
but A is about 9 months older than B, and the likelihood that A be HG in 3 years at your club assuming they both join you on 1st July 2015 is next to nil, while B is certainly going to be HG at your club.
hope that makes it clear?
best option is to use the squad screen menu, and look for due date/HG status.