Is this a common rail, electronic, injection system, or a mechanical injection?
You say it will turn over for a couple of seconds, then cuts out. Does this mean that it starts, but only runs for a couple of seconds, or that the starter will only operate for a couple of seconds at a time?
If mechanical injection, it will have a fuel cutoff solenoid on the injection pump. This is energised when running, and when de-energised, cuts the fuel supply. These can fail, stopping the fuel supply. Can be tested by applying 12v and listening for the click.
Common rail will have a pump in the tank that runs when the key is first turned to 'ign' (mar), then should run again when cranking, but will only keep running if told to after the engine starts. This is controlled by a relay, and takes a signal from either the crank sensor, or oil pressure. Check the relay. While there, check the relay/fuse box for water, they can collect water, and damage lots of connectors.