You cannot legally lock your spouse out of a shared household unless the court specifically grants such an order.
Under the Protection of Women from Domestic Violence Act, 2005, a wife has the right to reside in the shared household regardless of ownership.
If one spouse feels unsafe, they can seek:
A residence order from the court, or
A restraining order to prevent harassment or forced entry.
Any action taken without court approval may amount to unlawful eviction.