This summary is not the rule. The rule text controls.
Habeas corpus is a legal order that forces someone holding another person in custody to bring that person before the court. The person holding them also has to explain why they are being held. This gives the court a chance to check whether the custody is legal.
The word "custody" covers more than just being in jail. It also includes being detained or confined in other ways. So this rule can apply anytime someone is held against their will, not just in a traditional prison setting.
Anyone can start this process, not just the person being held. If someone is in custody and cannot file the petition themselves, another person can file it on their behalf. This makes sure that people who are held and unable to act for themselves, whether due to the conditions of their confinement or other reasons, still have a way to challenge whether their custody is lawful.