Sale of Rental Property

How do I break down the asset sales price, asset sales expenses, land sales price, and land sales expenses? Where or can I write off the commission, title fees, and mortgage payoff? Do I work off of the sold price of the property or the due to seller amount?