8 "Unanswered Questions" From Avengers: Endgame, Explained
4. Why Is Peter Parker Back In School With All Of His Classmates?
Joe Russo has explained this one. The only other character we see Peter interact with in school is Ned, though the trailers from Spider-Man: Far From Home do indicate that all of the prominent students from Homecoming are still students post-snap restoration, and therefore haven't aged.
It's a little convenient in terms of storytelling, but the only students who aged during the five years were unseen characters, as Russo explained: "there are people in [Peter's] grade whom didn't die and [are] probably already in colleges by now."
Some of Peter's school's students are people that Peter, Ned, MJ and Flash would know and some of them would be new students that have aged over the five years. Everything does go back to normal fairly quickly, though. Speaking of...