年内 and 年中
年内—within a year
(Maybe) counterintuitively this doesn’t mean anything like “in this/a year”, but rather within the/a year or by the end of the year. It can be further modified by adding a number in front like in:
This work must be finished within two years.
年中—the whole year
Again, this one is kind of counterintuitive as it doesn’t have anything to do with the “middle of the year”, but the whole year.
年来 and 来年
This means for some years and can be specified by adding a number in front of it like:
for five years
Now that one is a little bit nicer than the rest since it can be translated word by word, since next+year is next year.
先年 and 去年
That’s a particularly nasty one: Previous+year does not mean previous year which would not seem to be too far-fetched after learning 先月=last month), instead it means former years or a few years ago.
At least past+year means last year. There is still hope!
Another “exception” that doesn’t really fit into this article’s structure but will be pointed out nonetheless is 近年, meaning recent years. I find it a little bit confusing because of 近日, which does not mean recently, but soon.