Want to really get to understand canon? Try to follow the entirety of Star Wars! There's like 6 different levels of canonicity, some of which is debated on a daily basis...

But on the plus-side, it's one of the few franchises where the "Expanded Universe" (everything aside from the movies and The Clone Wars) is actually pretty cohesive and coherent, which makes following them that much more fun.
Sonic's canon seems to be up to whoever has control at the time. And in fact, if you look at other mediums, there's several different Sonic canons: the main games, the main games & handhelds, the Archie comics, the Fleetway comics, AoStH, SatAM, Sonic Underground, Sonic X, Sonic OVA, etc.
Generally though, the official canon is only the primary productions in the franchise, such is the case with Star Trek (only the 11 movies and 5 tv series count....although I understand the creator de-canonized the animated series and Star Trek V). So by default, Sonic game canon is only the main games in the series: Sonic 1, 2, 3 & Knuckles, Sonic Adventure, Sonic Adventure 2, Sonic Heroes, Sonic 2006, Sonic Unleashed, Sonic Colors, Sonic Generations, Sonic 4. Sonic Generations was a good standard to show which games are included and which ones are only minorly referenced.