Each year your loss limit was figured using Form 8582 When you fully dispose of the activity (in a taxable sale) in which you had suspended passive losses you will be able to claim all of the suspended loss that has been carried over and not allowed in prior years. See Passive Activity Loss ATG for details.
You will figure your gain in the usual manner of the excess of the sales price less selling expenses over the purchase price plus costs of buying plus improvements less depreciation. The land will be separately reported from the building and any other assets such as furniture will also be separately reported.
The gain or loss on the sale of rental property is reported on Form 4797 , Sale of Business Property. and Form 1040, Schedule D , Capital Gains and Losses, is used in conjunction as the amounts flow from the Form 4797.
For further information, refer to Publication 544, Sales on Other Disposition of Assets, Publication 550, Investment Income and Expense and the Instructions to Form 4797 , Sale of Business Property.
I hope this helps for the general rules of deducting the suspended loss and for reporting the gain on the sale.