No, there are rules. There are 3 different places for student loan repayment.
From 1040ME General Instructions:
Line 4. Student Loan Repayment Tax Credit. Graduates of accredited colleges and universities who have obtained an associate, bachelor’s, or graduate degree may qualify for a refundable credit based on certain loan payments made in 2023.
Line 14. FAME nonprofit student loan repayment program. An individual taxpayer may claim, to the extent included in federal adjusted gross income, the income subtraction modification for student loan 7 SCHEDULE 1S — Income Subtraction Modifications - See pages 21 and 22 For more information on Maine income modifications, visit www.maine.gov/revenue/tax-return-forms. payments made directly to a lender on behalf of the taxpayer by a student loan repayment program funded by a nonprofit foundation and administered by the Finance Authority of Maine for residents of the State employed by a business located in the state. 36 M.R.S. § 5122(2)(XX).
Line 15. Qualified health care student loan payments. A qualified health care employee (generally, an individual who is licensed as a registered nurse, practical nurse, osteopathic physician, or to practice medicine or surgery and is employed by a hospital in Maine) may claim, to the extent included in the employee’s federal adjusted gross income, the income subtraction modification for student loan payments made by an employer directly to the lender. 36 M.R.S. § 5122(2)(SS).