can I stay away from IIT campus that is not to stay in hostel
It is not compulsory as Institutes doesn't enforce anyone to stay in the Hostel.
If you can afford then you can live outside as a Day Scholar's or if you live nearby the college then you can opt for living in home.
But i would suggest you to take the Hostel for 2 years atleast, if you don't live nearby as it will help you to grow and you will meet various Students with same tangent.