Update #2
One way to size the frame to the final text is to save the y-position at the end of the document, and then use that to calculate the `\layerheight' on the final page.
This solution uses zref
to find that position. You'll need two runs.
\documentclass{article}
\usepackage{scrlayer}
\usepackage{multicol}
\usepackage[savepos]{zref}
\usepackage{lipsum}
\newlength{\marginpadding}
\setlength{\marginpadding}{4pt}
\DeclareNewLayer[textarea,background,mode=picture,
addheight=2\marginpadding,
addwidth=2\marginpadding,
addhoffset=-\marginpadding,
addvoffset=-\marginpadding,
contents={%
\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
\putUR{\line(-1,0){\LenToUnit{\layerwidth}}}%
\putUL{\line(0,-1){\LenToUnit{\layerheight}}}%
}]{topbox}
\DeclareNewLayer[clone=topbox,
contents={%
\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
\putUL{\line(0,-1){\LenToUnit{\layerheight}}}%
}]{midbox}
\DeclareNewLayer[clone=topbox,
height={\pdfpageheight-\zposy{textbottom}sp-\layeryoffset-\baselineskip+\marginpadding},
contents={%
\putLL{\line(1,0){\LenToUnit{\layerwidth}}}%
\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
\putUL{\line(0,-1){\LenToUnit{\layerheight}}}%
}]{bottombox}
\DeclarePageStyleByLayers{firstpage}{topbox}
\DeclarePageStyleByLayers{midpage}{midbox}
\DeclarePageStyleByLayers{lastpage}{bottombox}
\pagestyle{midpage}
\begin{document}
\thispagestyle{firstpage}
\begin{multicols}{2}
\lipsum[1-10]
\end{multicols}
\lipsum[1-2]
\begin{multicols}{2}
\lipsum[1-10]
\end{multicols}
\zsaveposy{textbottom}
\thispagestyle{lastpage}
\end{document}

Updated Answer (2020/07/06)
I'm still not completely clear on your requirements, but if what you're really asking for is a frame whose size is fixed and simply adapts its shape depending on what page you are on, you can do this with the page styles provided by the scrlayer
package.
The following works as long as you know you have more than one page of content. (You could add some logic to test for a one-page doc if you really needed it.) The basic idea is to create three page styles, make the middle page style the default, and set the top and bottom styles for a single page at the beginning and end.
The frame is very simple (it's adapted from the KOMA-Script manual--see chapter 17), but you could replace the contents with a much more sophisticated image if you desire.
\documentclass{article}
\usepackage{scrlayer}
\usepackage{multicol}
\usepackage{lipsum}
\newlength{\marginpadding}
\setlength{\marginpadding}{4pt}
\DeclareNewLayer[textarea,background,mode=picture,
addheight=2\marginpadding,addwidth=2\marginpadding,
addhoffset=-\marginpadding,addvoffset=-\marginpadding,
contents={%
\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
\putUR{\line(-1,0){\LenToUnit{\layerwidth}}}%
\putUL{\line(0,-1){\LenToUnit{\layerheight}}}%
}]{topbox}
\DeclareNewLayer[textarea,background,mode=picture,
addheight=2\marginpadding,addwidth=2\marginpadding,
addhoffset=-\marginpadding,addvoffset=-\marginpadding,
contents={%
\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
\putUL{\line(0,-1){\LenToUnit{\layerheight}}}%
}]{midbox}
\DeclareNewLayer[textarea,background,mode=picture,
addheight=2\marginpadding,
addwidth=2\marginpadding,
addhoffset=-\marginpadding,
addvoffset=-\marginpadding,
contents={%
\putLL{\line(1,0){\LenToUnit{\layerwidth}}}%
\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
\putUL{\line(0,-1){\LenToUnit{\layerheight}}}%
}]{bottombox}
\DeclarePageStyleByLayers{firstpage}{topbox}
\DeclarePageStyleByLayers{midpage}{midbox}
\DeclarePageStyleByLayers{lastpage}{bottombox}
\pagestyle{midpage}
\begin{document}
\thispagestyle{firstpage}
\begin{multicols}{2}
\lipsum[1-10]
\end{multicols}
\lipsum[1-2]
\begin{multicols}{2}
\lipsum[1-10]
\end{multicols}
\thispagestyle{lastpage}
\end{document}
Original Answer
Welcome to Tex.SE.
You could try the package multicolrule
. The idea is to create a "column separator" for multicols that actually draws a box around the outside of the columns instead of between them.
\documentclass{article}
\usepackage[tikz]{multicolrule}
\usetikzlibrary{calc}
\usepackage{lipsum}
\SetMCRule{color=gray,width=0.4pt, expand=2pt, custom-line={
\coordinate (TOPLEFT) at ($(TOP)-(\columnwidth+.5\columnsep,\columnseprule)$);
\coordinate (TOPRIGHT) at ($(TOP)+(\columnwidth+.5\columnsep,-\columnseprule)$);
\coordinate (BOTLEFT) at ($(BOT)-(\columnwidth+.5\columnsep,-\columnseprule)$);
\coordinate (BOTRIGHT) at ($(BOT)+(\columnwidth+.5\columnsep,\columnseprule)$);
\draw[line width=\columnseprule] (TOPLEFT) -- (TOPRIGHT) -- (BOTRIGHT) -- (BOTLEFT) -- cycle;}}
\begin{document}
\begin{multicols}{2}
\lipsum
\end{multicols}
\end{document}
This version puts the lines exactly around the edge of the boxes, but you could add a gap if you wanted.