To remove your iCloud account via iCloud.com, simply do the following:
Make sure your device is switched off.
Log into iCloud.com using your Apple ID.
Select Find My iPhone (1)
At the top of the screen in the centre, you’ll see a drop down menu labelled ‘All Devices’, select your device from here. Your device should appear as ‘Offline’.
Please note: Unless your device is switched off, it won’t appear as ‘Offline’ on iCloud.com. You may have to wait a few minutes after your device has been switched off for it to appear as ‘Offline’.
Select the ‘Remove from Account’ option (2)
Select ‘Remove’ on the confirmation message.