There should be 5 wires,
In no particular order...
1 = 12 volt supply from ecu to coil solenoid.
2 = GND from ECU to coil solenoid
3 = 5V from ECU goes to the resistor network inside the egr valve
4 = feedback signal goes to the ecu telling it what position the valve is.....
5 = GND from ecu to resistor network in EGR...
For a better understanding of how this works have a look here....https://www.youtube.com/watch?v=bH21cvhIxJo
You need to sort the wiring out....and hopefully havent damaged the ecu in the process...........
I got to be blunt here...you need 3 things when working on car electrics...
1) a decent meter (DVM)
2) a decent wiring schematic and be able to read it
3) Know what you are doing....
Its no good bumbling about like Columbo....