OP, reading your post is concerning. First off if you transerred to another unit within the same hospital, most places consider that as consecutive time at the same place. I read in your post that it seems when things get tough, or are stressful, or you feel overwhelmed you leave your job. I doubt very much you would get a job in L&D without a strong med/surg background. And what are you going to do when the going there gets tough? L&D is very rewarding, but also very stressful (I remember being literally shoved out of the way by a L&D nurse, in clinicals when holding a leg during a birth when the baby had a shoulder dystocia) The Obstetrics orientation would be tough, much tougher, than a med/surg floor. So you asked for help, here are my suggestions:
1. sit down and ask yourself why you went into nursing. For the science?, the money?, the esteem?, etc.
2. then sit down and write down EVERY nursing job you've had since graduation, how long you were at them, and the true reason you took the job, and the true reason you left for every job.
3. see if there is a common denominator for why you took the job and why you left. money?, desperation?, fear?.
Once you have an answer you can begin to figure out where your problem lies, I would also suggest going back to your nursing school and talking to a career counselor there, and it may be worth speaking to your PCP to see if there is an underlying anxiety or depression issue that could be affecting your ability to be long term anywhere.
Good luck to you. I hope you can find a position that fits you.