The principal residence exclusion requires that it was your primary residence for at least 24 months of the 60 months prior to sale. .........We've been renting that place out for about 10 years now. So aren't I going to have to recapture depreciation?

Technically, no, you shouldn't. Now, the depreciation taken will reduce your basis, and thereby increase your gain. But if it's only been a rental for 10 years, it all should have been straight-line depreciation. So it's not "recaptured", which means treated as ordinary income on sale. It's that other category, "Unrecaptured Section 1250 gain" that you see on various 1099s or K-1s. It's still capital gain, but the maximum rate goes up to 25%.

I know the original basis. And if I get the amount of "excess funds," what else do I need to figure profit/loss?

Your proceeds will be the loan payoff from the foreclosure PLUS the "excess funds" received. That amount, compared to your adjusted basis (after depreciation) will be your gain/loss.

And you report the gain/loss on Form 4797, and from there the net capital gain flows to Schedule D. But if it's a net loss, it's ordinary. And gain on any personal property involved will also be ordinary. Any gain on personal property is recaptured as ordinary to the extent of depreciation taken.