1. Go to https://developer.apple.com/xcode/
2. Click on "View in Mac App Store"
3. In the AppSotre window, select "Free" and click on "Install App"
4. Finally enter your Apple ID credential to start the installation
Note: The installation might take a while all as Xcode's size is over 2GB