What were the two months rent for? People don't normally pay in advance, so was that back rent that you owed? If so, you owed it and you paid it. That's the end of it.
If the property is foreclosed, you have to move. Foreclosure cancels any lease you have. There is nothing that you can argue about; out you go.
I suggest that you counter offer and tell them you will move out if you get the rent you paid in advance returned, plus the $500 they offered. If you paid 2 months in advance, you owe for this month's rent, but they owe you a refund for next month.
I suggest you look harder for a new place, because when the bank gets the place back, they don't have to give you any notice at all, and you are out. The courts will enforce the bank's rights and have the sheriff toss you out if you don't leave.
If the $500 is the best you can do, better grab it. If the landlord is getting foreclosed, he doesn't have any money, so it would be a waste of your time to sue him. It almost sounds to me like the $500 isn't coming from the landlord. It sounds more like a very nice gesture from the listing agent to try to help you out.
Just a suggestion: if this is a house and not an entire apartment building, you could make an offer and buy the house for yourself. Usually foreclosed property is sold at a bargain price. It might be your opportunity to buy a house for yourself.