Here is my attempt. Since there was unfortunately no information about the preamble, especially about the documentclass, in the question, I had to guess. Based on the sans serif font in the headings in combination with a serif font in the actual table, I assume, you used one of the KOMA script classes. For my MWE, I opted for the scrartcl class.
As mentioned in a previous comment, I don't really see the need to rotate the table, given the information you provide so far. If you get a different output, and you can't seem to fit the table into the avialable space, please update your question as described in my previous comment.
In my MWE, I included two versions of your table, a rotated one and one that isn't rotated. In both version, I used the siunitx package in order to improve the alignment of the numbers in your table. Depending on the entries in all the other table rows, you might have to adjust the values of table-format accordingly. (Red lines in the following screenshot indicate the margins.)

\documentclass{scrartcl}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{siunitx}
\sisetup{
group-digits = true,
group-minimum-digits = 4,
group-separator = {,},
table-align-text-pre = false,
table-align-text-post = false,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-space-text-pre = {(},
}
\begin{document}
\section{Robustness checks}
\label{rob_check}
\subsection{Maximum daily temperature}
\label{maximalka}
\begin{center}
\begin{sideways}
\begin{minipage}{1.3\textwidth}
\captionof{table}{Homicides per \num{1000000} people - Poisson regression. Maximum daily temperature.} \label{HomTmax}
\centering
\sisetup{group-digits=false}
\begin{tabular}{@{}l
S[table-format=-1.5]
S[table-format=-1.3]
c
S[table-format=-1.4]
S[table-format=-1.3, table-space-text-post={)}]
S[table-format=-1.3, table-space-text-post={**}]
c
S[table-format=-1.3, table-space-text-post={)}]@{}}
\toprule
\textbf{Variable} & \textbf{(1)} & \textbf{(2)} & \textbf{(3)} & \textbf{(4)} & \textbf{(5)} & \textbf{(6)} & \textbf{(7)} & \textbf{(8)}\
\midrule
Temperature & -0.0008 & -0.018 & &-0.0002 & -0.01 & -0.026**& & -0.009 \
& (0.007)& (0.01) & & (0.007)& (0.007) & (0.012)& & (0.007)\
\end{tabular}
\end{minipage}
\end{sideways}
\end{center}
\clearpage
\section{Robustness checks}
\label{rob_check}
\subsection{Maximum daily temperature}
\label{maximalka}
\begin{table}[hbp]
\caption{Homicides per \num{1000000} people - Poisson regression. Maximum daily temperature.}\label{HomTmax}
\centering
\small
\sisetup{group-digits=false}
\begin{tabular}{@{}l
S[table-format=-1.4]
S[table-format=-1.3]
c
S[table-format=-1.4]
S[table-format=-1.3, table-space-text-post={)}]
S[table-format=-1.3, table-space-text-post={**}]
c
S[table-format=-1.3, table-space-text-post={)}]@{}}
\toprule
\textbf{Variable} & {\textbf{(1)}} & {\textbf{(2)}} & {\textbf{(3)}} & {\textbf{(4)}} & {\textbf{(5)}} & {\textbf{(6)}} & {\textbf{(7)}} & {\textbf{(8)}}\
\midrule
Temperature & -0.0008 & -0.018 & &-0.0002 & -0.01 & -0.026**& & -0.009 \
& (0.007)& (0.01) & & (0.007)& (0.007) & (0.012)& & (0.007)\
\end{tabular}
\end{table}
\end{document}
sidewaystableis always placed on a separate page, see https://tex.stackexchange.com/questions/69286/rotate-table-with-caption-on-the-same-page for some options for having a rotated table on the same page as other text. Note also that if you use just[p]as the float specifier for a normal float, that means it always ends up on a page of it's own, because that's the only option you've allowed for. – Torbjørn T. May 08 '21 at 07:34\rotatebox{90}{% \begin{varwidth}{\textheight}but I got and errorYou can't use ``\vadjust' in internal vertical mode. \end{varwidth}{varwidth}}– vojtam May 08 '21 at 07:45\tabcolsep, your table probably fits into the textwidth even in portrait orientation. This is however hard to tell, since the textwidth is currently unknown. – leandriis May 08 '21 at 07:51\labelafter the corresponding\caption. – leandriis May 08 '21 at 07:54geometrypackage)? If so, include the correpsonding settings, as well. (See also: minimal working example (MWE)) While it is indeed a good idea to just include a part of a table in order to keep the example code concise, please make sure, that the code represents the contents of the actual table. What kind of contents do the columns "(3)" and "(7)" actually contain? How wide is the widest entry of each column? – leandriis May 08 '21 at 08:19