The procedure for claiming any overage resulting from a foreclosure varies from county to county. You are legally entitled to file claim to any excess amount created as a result of the sale that is above and beyond the judgement amount plus any fees associated with the sale and foreclosure of your home. There are not always pre-printed forms used in claiming these funds and may not be readily available in your county. Contact the county responsible for the foreclosure auction and review the file. Do not ask for anyone for information at first. (This is public information and you are allowed to view the file if you just ask) Review the file and then find out who and what entity is holding the funds. Find out from the office that is holding the funds the procedure for claiming the excess funds. You may or may not need an attorney but you will begin the process of recovering what is legally your right to claim. If there are no junior liens on the property the money is yours.
The $522k goes to pay off the mortgage and and other liens. If there is money left over from the sale, over and above the amount owed, then it goes to the foreclosed seller - I believe. That doesn't happen very often or the seller would have sold it rather than allow the foreclosure.