Straight from Pub 4681:
Student Loans
Certain student loans provide that all or part of the debt incurred to attend a qualified educational institution will be canceled if the person who received the loan works for a certain period of time in certain professions for any of a broad class of employers.
If your student loan is canceled as the result of this type of provision, the cancellation of this debt is not included in your gross income. To qualify for this treatment, the loan must have been made by:
1.
The federal government, a state or local government, or an instrumentality, agency, or subdivision of one of those governments,
2.
A tax-exempt public benefit corporation that has assumed control of a state, county, or municipal hospital, and whose employees are considered public employees under state law, or
3.
An educational institution (defined later):
a.
Under an agreement with an entity de-scribed in (1) or (2) that provided the funds to the institution to make the loan, or
b.
As part of a program of the institution designed to encourage students to serve in occupations or areas with un-met needs and under which the services provided are for or under the direction of a governmental unit or a tax-exempt section 501(c)(3) organization (defined later).
A loan to refinance a qualified student loan also will qualify if it was made by an educational institution or a tax-exempt section 501(a) organization under its program designed as described in (3)(b).Exception. Generally, the cancellation of a student loan made by an educational institution because of services you performed for that institution or another organization that provided funds for the loan must be included in the gross income on your tax return. Education loan repayment assistance. Education loan repayments made to you by the National Health Service Corps Loan Repayment Program or a state education loan repayment program eligible for funds under the Public Health Service Act are not taxable if you agree to provide primary health services in health professional shortage areas.
Amounts you received after 2008 under any other state loan repayment or loan forgiveness program also are not taxable. The program must be intended to increase the availability of health care services in underserved areas