For Coronaviruses, there’s no long-term immunity that would prevent reinfection, nor does it confer immunity that would last into adulthood. It’s measured in weeks and months. In the case of COVID, infecting children over and over again does not result in “training” their immune system, but instead weakens it, resulting in things like the pediatric care crisis we’ve seen in the US over the past year or so (as children were made more vulnerable to other diseases after having COVID).