How to resize editor that is inside of a window?

How the editor should look like…

How it looks like.

I have been playing with the rect and trying to get it to how it should look. I want in inspector to be on the right hand side in the 2nd picture. I can position the rect to that location, but when I resize it. It always clips the editor instead of resizing it. How can I resize the script as a whole, rather than clip. I have been playing with Editor.OnPreviewGUI(Rect r,…), GUI.BeginGroup(Rect r). They all move them, but all clip the editor view.

I have the proper rect. I fill in a Button on the spot I want filled up and looks perfect, but it doesn’t work with editor.

Okay, I finally figured it out after a bunch of trial and error. The one that works best is GUILayout.BeginArea