The answer to your question depends on the terms of your specific loan modification. In some cases lenders include a provision in a loan modification that enables them to recover any loss they incurred when the loan was modified, such as a reduction in your principal loan balance. Additionally, if any monthly payments, late fees or penalties were deferred when your mortgage was modified then you may required to repay these costs when you sell your home.
If your loan modification includes terms that allow your lender to recover a principal loss, forbearance or deferred payments or fees, then you may be required to give part of the proceeds you receive when you sell your home to the lender. For example, if your lender reduced or forgave $10,000 of your principal loan balance through the modification, there may be a provision in the modification that enables the lender to recover the $10,000 if you make a profit when you sell the home. Additionally, the lender may have included a provision that enables them to collect any late fees or penalties that were waived under the terms of the loan modification.
For example, if your lender reduced your principal loan balance by $10,000 and waived $2,500 in fees and penalties as part of your loan modification, the lender may be able to recover these items if you sell your home for a profit. If you have a $75,000 loan balance and sell your home for $100,000, you would be required to pay the lender $87,500 ($75,000 loan balance + $12,500 in principal and fee recovery) when the sale transaction closes. So instead of making a profit of $25,000 on the sale, you would only make a profit of $12,500.
If your loan modification does not include these principal reduction, deferred payments or fee recovery provisions then you can sell your home without any penalty and you are not required to pay the lender anything more than the amount required to payoff your current principal loan balance. For example, if you have a $75,000 mortgage balance and you sell your home for $100,000, you can keep the $25,000 profit, minus any real estate commissions and closing costs, after paying off your loan balance.
To determine how much money you owe your lender you can request a demand payoff statement at any time. The demand payoff statement outlines your current principal mortgage balance as well as any potential past due fees and penalties and deferred payments. You can use the demand payoff statement to better understand how much money you receive if you sell your home, depending on the sales price.
I also recommend that you review your loan modification documents to understand if it contains a loss recovery provision. I advise you to contact a real estate attorney if you have questions about the document or are unable to determine what happens if you sell your home for a profit.