The rental price is whatever the market will bear and has no relationship to taxes.
And yes the mortgage deduction is cancelled out by the income from the rent but most renatls purchased in the last five years lose money every month so the point is moot. Just like any investment, you don’t avoid profit just because there are tax implications.
Directly to your question, it is a little complicated but basically they can only deduct the loss between carry cost and rental income. If it is a rental that was purchased a long time ago, they will only pay tax on the profit if the rent is greater than the carrying costs.