For some kids, it’s been 18 months waiting to get back into a school building.

But barely three weeks into this academic year, children in four Philadelphia schools are back to virtual learning as coronavirus cases have led to temporary closures. Pottstown sent home three classrooms at the end of August. New Jersey has recorded six outbreaks.

So what determines whether a school closes or classes quarantine, and who gets to decide? It depends.

Philadelphia health officials say schools must temporarily shut down if they record six COVID-19 cases over the course of 14 days, which was the decision at Richmond Elementary and Emlen Elementary in the school district, and Lindley Academy and Pan American Academy charter schools.

Suburban Pennsylvania counties don’t appear to have a similar rule, though Montgomery County officials said they were referring schools to state Department of Health guidelines, which say closure “may be recommended” if a school’s cases surpass 5% of its population — or it experiences “three simultaneous outbreaks” in classrooms, sports teams or activities.

Health experts said creating broad rules that can apply to every school — or even every class within a school — is difficult. Among the variables to consider: students’ ages, vaccination rates among those who are eligible, what types of activities students participate in, and how well students are able to socially distance in the classroom, said Doug Thompson, the chief medical officer at St. Christopher’s Hospital for Children in Philadelphia.

“At the end of the day it’s all going to be about the risks and the benefits,” Thompson said.

It’s unclear how many schools or classrooms in Pennsylvania have closed so far this year. State health officials did not provide numbers and also haven’t been reporting cases in schools — but said this week that infections among the state’s school-age children were 10 times higher than they were at this time last year.

In New Jersey, officials said Wednesday there have been six school outbreaks involving 20 students and staff — the state has nearly 2,500 schools — but did not describe any closures.

Both states say school districts make the ultimate decision on when to close. And while few have done so, some school leaders say managing the ripple effects of the virus this year — with schools across the region fully open, unlike last year’s largely virtual start — is proving a significant challenge.

“This year is far worse than last year,” said Pottstown Superintendent Stephen Rodriguez, whose district closed a kindergarten and two fifth-grade classrooms a week into the year after noticing a pattern that suggested spreading cases.

“When we were virtual, someone got COVID, we just kept moving,” said Rodriguez, who said his district has quarantined nearly 10% of its 3,500 students so far and is sending students home daily because they have symptoms. “Now, it’s all we can do to know who should be in and who should be out.”

» READ MORE: COVID-19 cases among Pa. school-age children are 10 times higher than they were last year

Nationally, decisions on how to keep schools open have trickled down to individual districts, which are “under a tremendous amount of pressure from their own community,” said Dan Domenech, executive director of the American Association of School Administrators. And amid a patchwork of vastly different state approaches to pandemic management — from school mask mandates and bans to vaccination policies — “it’s the wild, wild West out there,” Domenech said.

In Pottstown — among the districts that began the year with a mask mandate, before the order from Gov. Tom Wolf’s administration — Rodriguez was hesitant to share the number of cases that prompted the classroom closures. “People will assume certain thresholds where they shouldn’t,” he said, noting that other classrooms with more infections may be able to remain open if the cases aren’t connected.

“Unfortunately, when it comes to public health ... everybody just wants the answer,” Rodriguez said, whose district has been working with the Montgomery County Office of Public Health to respond to cases.

A spokesperson for that office said it refers schools to guidelines put forward by the state Health Department.

Maggi Barton, a spokesperson for the state department, said Pennsylvania makes recommendations if schools seek its guidance, or as part of “efforts to communicate with school districts prompted by large case increases and/or case investigation findings.”

» READ MORE: Pa. school mask exemption loophole draws pushback from Wolf administration

Specifically, the department says it may recommend closures for schools with case counts reaching 5% of their population over 14 days — from 25 cases in small schools of under 500 students or staff, to 45 cases in schools of more than 900 — or with three simultaneous “classroom and/or core group outbreaks.” The guidance defined those outbreaks as “transmission between two or more students or students/staff/teachers without other identified epidemiological links.”

Barton said the guidance was “based on CDC recommendations intended to maximize keeping schools open and kids learning in-person.”

So is Philadelphia’s guidance, according to the city’s health department — which says three or more cases in one classroom requires the class to quarantine; three or more cases across a grade requires a grade to quarantine; and six or more cases across grades within a school within 14 days triggers temporary building closure.

The classroom and grade-level recommendations are based on how CDC defines a “cluster” in schools, said James Garrow, a spokesperson for the department.

“When three or more people are identified in a cohort or grade with COVID, we felt that the risk to the rest of the cohort/grade was great enough to warrant taking stronger actions such as quarantine,” Garrow said. In its guidance, the CDC describes a cluster as involving at least three linked cases: the first person to be infected, and two or more others “who had close contacts, places, and events in common and who likely were infected in school.”

“We had to set a threshold for when the risk was too great for others,” Garrow said, “especially in schools where children cannot be vaccinated, and settled on six or more cases or multiple clusters (also read as multiple groups of three). When we see this, we believe that there are undetected cases in schools.”

He added that the guidance “may change as we learn more, obviously, as with everything else during this pandemic.”

In New Jersey, the decision to close a school is left to local school boards and school superintendents in consultation with the county health department based on the exposure and community transmission, said Caryelle Lasher, an assistant Camden County health commissioner.

Different guidelines may be warranted depending on the community, said Kelly Bradley-Dodds, a pediatrician at Einstein Medical Center in Philadelphia. For instance, a school in an old building with small classrooms and poor ventilation may need to take different precautions than a more spacious, newly built school, she said.

Elizabeth Stuart, a public health professor at the Johns Hopkins Bloomberg School of Public Health, agreed that context mattered in school closure decisions. But she questioned the rationale behind Philadelphia’s guidance, which “seems a little arbitrary.”

Stuart voiced support for “test to stay” programs that allow students who are close contacts of others with COVID to remain in school if they test negative each day. (Philadelphia has endorsed that approach for schools with one to two positive cases in a cohort, but says it is “paused due to rising case counts.”)

“We don’t want to be in a situation where there’s so much disruption,” she said.