Yes, assuming the tankless water heater meets the energy-efficient standards, found here. You would have needed to spend at least $2,000 on the water heater to receive the maximum credit of $600. The available credit is 30% of the cost, not to exceed $600.
1. Upon opening TurboTax, choose Deductions & Credits
2. Locate Your Home
3. Start/Revisit Home Energy Credits
4. On the Energy Efficient Home Improvements screen, select Yes then Continue.
5. Answer the next few questions until you get to Did you have any of these residential energy property costs in 2024? Water heaters are listed here. Select Yes and continue.
6. Make sure you enter the total cost and answer the questions about ownership and location of the home.
See this article for a summary of the amounts available: Energy Efficient Home Improvement Credit (EEHIC)