The nutritional value decreases over time, so hay of equal nutritional content is better the younger it is. But as Hopewell says, depending on the year(s), older hay may be better if the newer stuff was cut later in the season, for instance.
A couple of years back, after a very wet summer when no-one got very much hay at all let alone any good hay, we ended up using and even selling some 4-year-old hay. Everyone who used it said it was better than the hay from the most recent so-called summer.
I would have no qualms about using year-old hay for sheep, and two-year-old well-made hay should be fine too, although I'd expect to have to feed more of it.
Most horsey people want year-old or older, especially if they have ponies prone to laminitis, so that they can feed more bulk without putting on too much weight.