What counts as 4 years of postsecondary education?

I enrolled in a four year program fall 2017, I took a gap year from fall 2018 to spring 2019. I later withdrew fall 2020. By time, I was enrolled for 4 years 2017-2020. But I've only accrued 35 credits and my old school considers me a sophomore. I've never filled for the American opportunity tax credit but would like to know if I am eligible. I'm currently taking classes at my local community college.