Bharatiya Nyaya Sanhita, 2023
Section 332
House-trespass in order to commit offence
Whoever commits house-trespass in order to the committing of any offence—
(a) punishable with death, shall be punished with imprisonment for life, or with rigorous imprisonment for a term not exceeding ten years, and shall also be liable to fine;
(b) punishable with imprisonment for life, shall be punished with imprisonment of either description for a term not exceeding ten years, and shall also be liable to fine;
(c) punishable with imprisonment, shall be punished with imprisonment of either description for a term which may extend to two years, and shall also be liable to fine: Provided that if the offence intended to be committed is theft, the term of the imprisonment may be extended to seven years.
Why this exists
House-trespass is often just the first step toward a more serious crime. This section ensures the punishment for the trespass itself reflects the seriousness of what the trespasser actually intended to do once inside, so that someone breaking in to commit a grave crime like murder faces a much harsher penalty than someone trespassing with a lesser criminal purpose in mind.