The correct phrase is "it's a 5-year course." The term "year" is used as an adjective to describe the length of the course. You wouldn't say "it's a 5-years" because "years" is not used in this context.
It can be rephrased in several ways, such as:
- "The course lasts 5 years."
- "It's a course that takes 5 years to complete."
- "It's a 5-year program."
Feel free to choose any of these alternatives based on your preference!