Controlling a 24VAC solenoid with arduino
after adding the TVS diode it's not happening but is the correct use
  for this diode?


You need a back-to-back (or bidirectional) TVS diode i.e. one rated for AC. At the moment if you apply AC to the terminals (VAC1 and 2) and energize the triac it will short out the AC supply on positive half cycles.