How long is house arrest illegal?

As long as it is under house arrest, it is illegal, resulting in the crime of illegal detention.

According to the Criminal Code of People's Republic of China (PRC):

Article 238

Whoever illegally detains others or illegally deprives others of their personal freedom by other means shall be sentenced to fixed-term imprisonment of not more than three years, criminal detention, public surveillance or deprivation of political rights. Those who are beaten or insulted shall be given a heavier punishment.

Whoever commits the crime mentioned in the preceding paragraph and causes serious injuries shall be sentenced to fixed-term imprisonment of not less than three years but not more than ten years; Whoever causes death shall be sentenced to fixed-term imprisonment of not less than ten years. Whoever causes disability or death by violence shall be convicted and punished in accordance with the provisions of Articles 234 and 232 of this Law.

Whoever illegally detains another person or detains another person in order to claim debts shall be punished in accordance with the provisions of the preceding two paragraphs. Any functionary of a state organ who commits the crimes mentioned in the preceding three paragraphs by taking advantage of his power shall be given a heavier punishment in accordance with the provisions of the preceding three paragraphs.

Extended data:

If the perpetrator's illegal detention has multiple aggravating circumstances, he should be given a heavier punishment to a greater extent. For example, the staff of state organs illegally detained him by taking advantage of their powers, and he was also beaten or insulted. This is the case.

The object of the crime of illegal detention must be a natural person who has freedom of action in the place. Because people's actions are dominated by consciousness, the freedom of physical activity is the freedom of intentional activity, which is in a factual state and is not limited by the legal responsibility and legal capacity of the actor.

As for babies and highly mentally ill people, they lack the ability to decide the meaning of changing their place of stay and have no freedom of movement at all, so they cannot be the object of illegal detention. People who can move with crutches and children who can move alone may become targets of illegal detention.

China Court Network-People's Republic of China (PRC) Criminal Law

Baidu Encyclopedia-Crime of Illegal Detention