What constitutes 4 years of college credit for the American Opportunity Credit? Is it based off the number of credit hours or just more general?

I've been an on and off student for more than 8 years. Taken multiple credits at different colleges and transferred them. Do i go with how many credits my current college says I have and not include the other credits I've taken that didn't transfer?