If you have Steam by Valve Games on your PC you can get your copy of GameMaker Studio 2 by purchasing it on their store. However, if you have already bought GMS2 directly from yoyogames.com or elsewhere and want to link your account so you can use the Steam version without purchasing again (or you bought on Steam and now want to use the non-Steam version), then you can do that also.
This page will guide you through both options.
Purchasing GMS2 Via Steam
As with any product from Steam, it's simply a case of going to the Store, searching for GameMaker Studio 2 and then selecting the licence you want (information on the different licenses can be found here):
NOTE: Not all of the different GameMaker Studio 2 licences are available through Steam (for example, the Console or Creator licences are only available directly from YoYo Games).
Once purchased, it will then be added to your Steam Library and clicking on it will install it. Once installed, you can click the Play button in the Steam Client to launch GameMaker Studio 2.
On launch you will be prompted to sign in, which will require you to provide the username and password details for your YoYo Account.
IMPORTANT! When using GameMaker Studio from the Steam Client, the client must be online. GMS2 will not permit you to login while Steam is in offline mode due to the way that Steam locks down on network communication.
If you purchase additional licenses from the Steam Client, these will be added to the client as individual products. However, you only need to install one of them (doesn't matter which) and then in the Target Manager you will have access to all the targets applicable to the licences you own.
It wouldn't matter which of these you install/use; any of them would have all your purchases
Linking Your GMS2 Account To Your Steam Account
If you have already bought GameMaker Studio 2 from YoYo Games directly, you can link your YoYo Account with your Steam account and then use either/or of the versions (the Steam client version, or the standalone executable). To link accounts, go to your YoYo Account dashboard and then Settings > Linked Accounts and click the "link" button:
Clicking the button will open a new browser window to the Steam site asking you to authorise access to YoYo Games, and once you have signed in you'll be taken back to your YoYo Account page where it'll say that you are linked. You can now download GMS2 from Steam and use it from within the Steam Client.
The opposite is also true, and if you have bought a GameMaker Studio 2 licence on Steam, you can link the accounts and get the same licence applied to the stand alone executable of the product.