Setup arduino uno with ESP8266 ESP-1
You must have your microcontroller in place if you are uploading code to it. 

You can talk to ESP8266 via serial monitor because you are connected directly to the pins of your USB-UART bridge.

Place your uC back, change this line of code:

SoftwareSerial ESP8266(0, 1);

to this one:

SoftwareSerial ESP8266(8, 9);

and change your wires accordingly(what was on pin 0, now connect to pin 8, pin 1 to pin 9).
Now your Atmega can talk to ESP8266 after you upload the code. 

btw. "Serial2" is Serial port for more advance Arduino boards, it won't work on Atmega328 based board.