The two-temperature, 2D hydrodynamic code Hydro-ELectro-IOnization-2-Dimensional (HELIO2D), which takes into account self-consistently the laser energy absorption in a target, ionization, heating, and expansion of the created plasma is elaborated. The wide-range two-temperature equation of state is developed and used to model the metal target dynamics from room temperature to the conditions of weakly coupled plasma. The simulation results are compared and demonstrated a good agreement with experimental data on the Mg target being heated by laser pulses of the nanosecond high-energy laser for heavy ion experiments (NHELIX) at Gesellschaft fur Schwerionenforschung. The importance of using realistic models of matter properties is demonstrated.