Path corners should closing neatly

I watched some Illustrator videos and also searched the net. Also here in the forum I looked something, but don't really know what to look for.
Maybe you can help me solve my problem.
I would like to draw with paths more often, but I always have the problem that I can only join two open path ends. But what if I want to create a shape. In the following example I want to create this drawing, but the corners always protrude. I just can't get the corners together neatly.
I've found this tried on, but I don't get it right and I think it's just only a similar problem in another case.
Also this will not work for me:
https://community.adobe.com/t5/illustrator/join-paths-while-preserving-all-lines/m-p/9366769
Can you help me?
Hint: If I want to add the ai file I get always the following message. This is why I cannot uplad the ai file.
Correct the highlighted errors and try again. The attachment's form.ai content type (application/postscript) does not match its file extension and has been removed.
