I believe the answer is: All of the above
A person is considered to be put under custody if he/she no longer has the freedom to go to anywhere they want and has to be detained in a certain place.
The purpose of this is to make sure they attend the trial/hearing that would be conducted soon after.