2002 Mercedes Benz ML500

My ml500 will be running smooth then dash lights all go on and the car goes into limp mode. I shut off the motor and it will be start up just fine. I replaced the crank position sensor and the cam position sensor. Problem got worse. Now, sometimes the engine will not start. After a few minutes will start. Driving will just die. Will start up after a few minutes. I can hear the fuel pump. What can it be?