Yes it is mandatory to stay in hostel in first year. After that you can choose not to stay in hostel or you can stay in hostel. You are provided with the choice to stay off campus with the condition that you make your arrangements at your own cost.
Hope this helps,
In IIM Bangalore it is mandatory that you stay in the hostel for first year of MBA. After that in 2nd year you have the option of either staying in the hostel premises or you can stay outside off-campus. You have to make your own arrangements on your own cost if you are staying outside the campus.