rbynaker
Level 14

Take a look at Pub 525 page 37 (2022) under Repayments:

https://www.irs.gov/pub/irs-pdf/p525.pdf

There are some nuances to it.