are you familiar with the package scrlayer-scrpage? This one allows you to modify your page layout a bit more in detail. It takes a while to read through the documentation and it is not too easy to find exactly what you are looking for. However, a good Google search in combination with scrlayer-scrpage will help you further.
I created a small example, which always put the "active" element in the Header, which is the {section, subsection, etc} mentioned last. I uncommented some lines (%lehead to %cofoot). You can use those if you want to write a specific term at a certain Position, like your Name for example. This is for documents like books where you have two pages next to each other. First letter can be l (left) c (Center) or r (right) than e (for even numbered page) or o (for odd numbered pages) and then head for the Header and foot for the foot part of the page.
Please check if you can compile it and if it is what you were looking for.
Best regards, Bastien
\documentclass[a4paper,11pt]{scrartcl}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[automark, headsepline, footsepline]{scrlayer-scrpage}
\clearpairofpagestyles
\automark*{section}
\automark*{subsection}
\automark*{subsubsection}
\ihead{\headmark}
\ohead*{\pagemark}
%\lehead{}
%\rehead{}
%\lohead{}
%\rohead{}
%\cefoot{}
%\cofoot{}
\pagestyle{scrheadings}
\begin{document}
\section{Section A}
\blindtext
\subsection{Subsection a}
\blindtext
\blindtext
\subsection{Subsection b}
\blindtext
\blindtext
\newpage
\subsection{Subsection c}
\blindtext
\section{Section B}
\blindtext
\subsection{Subsection c}
\blindtext
\blindtext
\subsection{Subsection d}
\blindtext
\newpage
\section{Section C}
\blindtext
\subsection{Subsection e}
\blindtext
\end{document}