engine shuts off

Hey guys. First time poster, ive acquired a 2004 subaru liberty with abit over 200km.. I've had it for 2 weeks now. Everything has been great til today after an hours drive, turned off the car and waited to pick up my son from school. After 10secs of driving the car hesitates under acceleration and then dies. Happened to me on the way home also. Can someone please shed a light on what it could be.
Thanks
Thanks