House rent tax treatment for employee of a private company


One private company has house rent allowance/accommodation facility based on the family structure of its employees as below:
That company provides both accommodation facility and cash for two types of employee(Bachelor and Family) under following conditions

Bachelor : If employee is bachelor then s/he gets accommodation and s/he has to refund/pay back some of house rent cash(given to him/her) to the employer.
Family: If employee lives with his own family then s/he gets accommodation as before but s/he has to refund/pay back the WHOLE amount of house rent cash (given to him/her) to the employer.

Now what will be the tax treatment, in 2017-2018 assessment year, for both Bachelor and Family in the light of section of IT act 1961 and IT rules??