If you believe the equivalencies listed at https://admission.universityofcalifornia.edu/admission-requirements/freshman-requirements/subject-requirement-a-g.html (click on “Exams and coursework that satisfy E”), you will see that the University of California considers a 520 on the Spanish SAT subject test to be equivalent to completion of high school Spanish year 2 for the purpose of meeting the minimum requirements for frosh admission.
Of course, your high school’s Spanish year 2 course may cover more or less material than typical, and how well you did in the course will also affect what you you get on the Spanish SAT subject test.
AP Spanish courses are typically year 4 or 5 in most high schools that offer them.