About 20 pupils fell ill at Flash Ley Community Primary School and Nursery in Stafford in October amid reports of a mystery smell.
An investigation has concluded that work to floor ducts last summer led to high levels of the chemical, Staffordshire County Council said.
The Hawksmoor Road school has been shut on safety grounds ever since.
Repairs will now start in March and completed in time for the new school year in September.
The building will undergo a deep clean and the substance believed to be behind the presence of formaldehyde in the air removed.
Children will continue lessons at the nearby Chetwynd Centre, Tillington Manor Primary and Stafford Manor High School.
Councillor Ben Adams, cabinet member for learning and skills, said: "Children and staff will only return to the building once extensive tests show that is safe to do so."
Head teacher Simon Barker said: "We are delighted that the county council have announced the decision and staff will now begin to make plans to ensure the arrangements for September will be in place and the transition back to Flash Ley will be smooth.
"I would personally like to thank the children, parents and staff for their support while we have been temporarily moved. We can now look forward to a safe school to educate our children."
Formaldehyde is a colourless gas with a pungent odour and is found in materials used in plywood, carpeting and foam insulation.
Those exposed to it can suffer irritation to the eyes, nose, mouth and throat.
It is understood parents reported children with symptoms of nausea, vomiting and dizziness at the time.
A primary school will be closed until September after high levels of formaldehyde were discovered last year.