Hello
If you registered the Sims 2 and Sims 3 games to Ea when you installed the game, then they will be in your games library when you log in to origin. They need to have been registered to the same origin account as what you have used when registering sims 4, for them to appear when you log in to play Sims 4. You can then download /install them to your computer
If you didn’t register them but still have the product codes, you can log in to origin and register them now. They will be added to your games library.
Only you can play the games. Product codes can only be used once to register the game to an origin account.