Preschool is optional, and is referred to as "Educação Infantil" ([Early] Childhood Education).
Elementary or Primary is known as "Educação Fundamental" (Basic Education).
Middle School or Secondary School lasts 3 years, and is known as "Educação Secundária".
A grade or year used to be called a "série" (which is also our word for "series", by the way). The education system was recently changed and they are now officially referred to as "anos" (years). This change was rather new, so you'll likely hear a number of people refer to grades as séries.
I'm a 90's kid, and grew up going to segunda série (Grade 2), etc. As far as I know it was still called a série when I moved to Canada in 2001. That's how recent the change is.
Homeschooling is not an option in Brazil, to ensure no kids are being kept home to work.