Three of the main characters were the same actor, and yet there are shots with all of them in the same scene. When I saw this as a young adult I didn’t even notice that Mike Myers was playing three roles and was genuinely dumbfounded years later when I found out.
How did they do those scenes so seamlessly?
So, back in the day they used a really simple camera trick called a double exposure.
https://abeautifulmess.com/how-to-shoot-a-double-exposure-in-camera/
While technically simple, it demands a lot of coordination as the actor has to time their lines and actions flawlessly for the trick to work.
And before computer controlled motion tracking, you could not move the camera.