it may be against the terms of his mortgage but it's not actually illegal.
The bad new for you is you don't have a leg to stand on with the mortgage company, they will not care that you have been paying the rent, they have a contract with your landlord, not you!
If it gets to the stage that the property get repossessed then you will get some blokes turn up and give you a little time (10min or so) to get some stuff together and you will be out and they will change the locks. they also have no requirement to allow you access back into the property to reclaim your belongings (but they may let you arrange a time to do it off their own backs)
If I was you I would find somewhere else to rent and get out of there as quick as possible.
I know this is what happens as it did happen to me fairly recently, and the place I was living got reprocessed despite me having kept totally up to date paying the rent. they did allow me to arrange a time to claim all my belongings luckily but only because they understood my posistion and took pity on me.