This diagram is for a bar magnet, but it is the same for each of the coils in your diagram. You can see the flux lines extend out from the ends as well as the sides.
This shows the lines from a coil by using iron filings:
Neither of your drawings would work very well. Magnetic field lines in air look something like the drawing below. Lines further apart indicate weaker field. Not that the strongest field is through the middle. In your first diagram of both coils were wound on opposite sides of a soft iron core which would provide an easy circular path than air would improve the result hugely. In your second diagram, if both coils are wound on a cylindrical soft iron core you'd get an improvement, loop that around to make a rectangular core would make it better. Coils wound on top of each other, better still. Conventional transformers create a magnetic circuit with a (laminated) soft iron T slotted into a soft iron C and both coils are wound around the upright of the T, creating an efficient and cost effective "magnetic circuit"