You can use copper if you keep the pH between 7 and 8, and don't use salt.

The heat exchangers in commercial pool heaters are copper, just like they are in residential units. However, salt-compatible residential units have cupro-nickel exchangers -- stainless steel is a poor conductor and is not used.

NOTE: this is NOT a recommendation that you actually DO any of this. Building a heater is potentially life-threatening! It's surprisingly easy to build a water bomb -- when home water heaters explode they often level the house and kill everyone inside!

Here are 2 videos you should watch, before you go further:
50 Gallon water heater explosion
Mythbusters Water Heater Explosion