How To Remotely Remove an Apple ID From an Apple Device.
In order to remove an iCloud from a device please follow the steps below:
STEP 1 - Sign in to iCloud.com with your Apple ID and go to Find My iPhone.
Or if you have signed in press Find my iPhone.

STEP 2 - Click All Devices at the top of the screen and select the device that you want to remove from iCloud.
STEP 3 - Click Erase [device]. Select Next until the device is erased.
STEP 4 - Click Remove from Account.
Now the iCloud account should no longer be associated with the device.