I'm pretty sure they said he has a six film contract. Regardless, if they can't work out to extend his contract and keep him in the MCU after the contract expires, Sony will do one of two things: Work out a separate contract with Tom Holland or work out a contract with another actor and start over. It's possible (even probable) that their agreement with Marvel covers this contingency and Sony won't be allowed to make Spider-Man movies with Tom Holland without Marvel's consent. If so, only the second option is possible. However, with the first option, they could just continue movies without referencing but not contradicting what came before. Audience members would be confused on whether it's part of the same universe, but those who really care about these things can pay attention and find out.