How can I join two 2'x4' pieces of treated wood like in the picture so that the screws are not visible? Or maybe it's possible not to use screws?
There are a lot of ways you could go here.
Conceal The Screws
If you just make a simple butt joint like you have in your picture, you can do as @AlaskaMan says in the comments - countersink the screws and put a plug or putty over the screw head. That will hide the screw; the plug / putty will be visible but less noticeable than the screw.
Pocket screws mentioned by @JimStewart in the comments are usually stronger than straight screws. The pilot holes are drilled at an angle and the screw is countersunk; you cut an oval shaped plug if you want to conceal the screws. You could insert the screws from the inside of the frame, depending on what you're making here, they may not be visible on that side, even without the plugs.
You could use corner brackets, which are very easy to use, and in some configurations pretty strong. If you can put them on one side of the assembly that's out of sight, they may not be visible.
Join without Screws
One sure way to make sure you don't see the fasteners is to not use fasteners. These methods are important enough that there's a name for it - the craft of joinery. You could write a book about it, in fact many books have been written about it - here's one:
There are far more joints in that book than I have ever seen in actual use. One of the simplest is a simple half lap corner joint. This one just about anyone could make with just a hand saw, and with good glue used correctly, it will be stronger than a screwed joint.
But the half lap as shown will be stronger on a joint where the pieces are flat, you get more glue surface that way. With the pieces standing, in the configuration in your photo, a slightly more difficult joint would be better, a bridle joint:
A mortise and tenon joint is similar, a little harder to make, but with less visible seam:
There are many other variations and possibilities - box joints, doweling, biscuits, etc. etc. but hopefully this gives you some ideas.
Simple, pre-drill with a drill bit slightly smaller than the screw into the top of the overlapping 2x4 so that the drill bit goes through the 1st 2x4, then into the 2nd 2x4. For screws, use 3 in. or 4 in. and screw them in until the heads recess into the wood. Had to do this plenty of times to re-stud my interior wall, and build a frame for a small addition.