Most schools will only accept maximum of one year of credits. Maybe as a transfer applicant, maximum of two years. The principle is very simple. If a school awards you a diploma, they want to be the one who teaches you the majority of classes. They don’t want to put their stamp on an education that’s taught by mostly some other schools. The private schools are particularly strict about this.
Also typically the credit can be used only once unless special agreements exist between the programs in advance. If it’s used for a high school degree, it can’t be used for college degree. Same thing in college. If someone takes a graduate class to fullfill an undergraduate degree, that class typically can’t be used to fullfill a future graduate degree anymore.