In some cases, the defendant in a criminal matter may qualify for house arrest instead of being incarcerated. This is an especially important consideration in cases where there are mandatory minimum sentences, such as second offense DUIs and many drug cases. House arrest is an alternative sentence which allows the court to sentence the defendant to a term of home confinement (usually with an ankle bracelet of some form) instead of being sent off to prison.
House arrest allows the defendant to continue to work, to make scheduled appointments, and otherwise live their lives. The defendant is not restricted only to his/her home, as there will be scheduled times he or she can leave to go to work, run errands, etc. There is a requirement of a curfew, and many ankle bracelets now test for the presence of drugs or alcohol in a person's perspiration. But as long as the defendant is able to adhere to the requirements of the program, he or she stands a good chance of being admitted to it.
In my experience, any sentence longer than 3 months is unlikely (but not impossible) to qualify for house arrest. Of course, the defendant will be required to pay the costs of the program, which can be significant, but if the alternative is incarceration it is well worth the cost.