Can I include time spent as a student or worker?

Yes. Time spent lawfully in the UK under different visa categories may count towards the qualifying period, provided the Long Residence requirements are met.