In terms of profiles though, you do this: look at the images for reference (once they are uploaded to this post), but for this example I'll be using the Vanilla/Standard Launcher, you go to 'Launch Options' tab.
Create a profile (Add Profile button), select a Minecraft version (from the list), if you have Forge setup select the Forge version, Forge versions are at the bottom of the version lists usually, right below Version 1.0 of Minecraft Vanilla.
Select the 1.8 or 1.12.2, depending on what you want to do first. (I'll say 1.8 for this example to follow the images)
Create a new profile for your other version, do the same steps but for that other version. (I'll say 1.12.2 for this example).
Then your done, just switch between the versions in the profile list on your main Minecraft Menu of the Launcher you want and your good to go.
If your using another Launcher like MultiMC or Twitch though that can differ.
I feel like I should do a video on this now.