Here is a needspace solution.
\documentclass[12pt,twoside]{article}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage[usenames,svgnames,dvipsnames,table]{xcolor}
\colorlet{lightcyan}{cyan!40!white}
\setlength{\parskip}{1em}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{tasks}
\settasks{label-format={\bfseries}, column-sep={10pt}}
\usepackage[lastexercise,answerdelayed]{exercise}
\counterwithin{Exercise}{section}
\counterwithin{Answer}{section}
\renewcounter{Exercise}[section]
\newcommand{\QuestionNB}{\fbox{\bfseries\arabic{Question}}\ }
\renewcommand{\ExerciseName}{\textbf{Exercise}}
\renewcommand{\ExerciseHeader}{\noindent\def\stackalignment{l}% code from https://tex.stackexchange.com/a/195118/101651
\stackunder[0pt]{\colorbox{cyan}{\textcolor{white}{\LARGE\ExerciseName\;\textbf{\LARGE\ExerciseHeaderNB}}}}{\textcolor{lightcyan}{\rule{\linewidth}{2pt}}}\medskip}
\setlength{\QuestionIndent}{16pt}
\usepackage{stackengine}
\usepackage{needspace}
\begin{document}
\noindent\rule{\textwidth}{32\baselineskip}% 31\baselineskip will include part of the exercise
\needspace{2\baselineskip}% could be bigger
\begin{Exercise}
\Question Solve the following equations, giving exact answers.
\begin{tasks}(2)
\task $\dfrac{5}{x}=2$
\task $\dfrac{5x+6}{3}+\dfrac{4-x}{5}=3$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\end{Exercise}
\end{document}
This version only allows Exercises larger than 0.5\textheight to break over pages.
I originally used \box instead of \unvbox for the unbreakable version, but this caused problems with the spacing at the top of a page.
\documentclass[12pt,twoside]{article}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage[usenames,svgnames,dvipsnames,table]{xcolor}
\colorlet{lightcyan}{cyan!40!white}
\setlength{\parskip}{1em}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{tasks}
\settasks{label-format={\bfseries}, column-sep={10pt}}
\usepackage[lastexercise,answerdelayed]{exercise}
\counterwithin{Exercise}{section}
\counterwithin{Answer}{section}
\renewcounter{Exercise}[section]
\newcommand{\QuestionNB}{\fbox{\bfseries\arabic{Question}}\ }
\renewcommand{\ExerciseName}{\textbf{Exercise}}
\renewcommand{\ExerciseHeader}{\noindent\def\stackalignment{l}% code from https://tex.stackexchange.com/a/195118/101651
\stackunder[0pt]{\colorbox{cyan}{\textcolor{white}{\LARGE\ExerciseName\;\textbf{\LARGE\ExerciseHeaderNB}}}}{\textcolor{lightcyan}{\rule{\linewidth}{2pt}}}\medskip}
\setlength{\QuestionIndent}{16pt}
\usepackage{stackengine}
\usepackage{needspace}
\usepackage{environ}
\newsavebox{\exercisebox}% just in case
\NewEnviron{ExerciseBox}{\par
\setbox\exercisebox=\vbox{\BODY}% measure height
\ifdim\ht\exercisebox>0.5\textheight
\needspace{2\baselineskip}% still want to avoid naked header
\else
\needspace{\ht\exercisebox}% to use \unvbox instead of \box
\fi
\unvbox\exercisebox}
\usepackage{showframe}% alignment tool
\begin{document}
\begin{ExerciseBox}
\begin{Exercise}
\Question Solve the following equations, giving exact answers.
\begin{tasks}(2)
\task $\dfrac{5}{x}=2$
\task $\dfrac{5x+6}{3}+\dfrac{4-x}{5}=3$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\needspace{2\baselineskip}% you may wan to patch the \Question command
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\end{Exercise}
\end{ExerciseBox}
\noindent\rule{\textwidth}{25\baselineskip}
\begin{ExerciseBox}
\begin{Exercise}
\Question Solve the following equations, giving exact answers.
\begin{tasks}(2)
\task $\dfrac{5}{x}=2$
\task $\dfrac{5x+6}{3}+\dfrac{4-x}{5}=3$
\end{tasks}
\Question Solve, giving your answers correct to 3 significant figures.
\begin{tasks}(2)
\task $\dfrac{x(x+1)^2}{3(x-1)}=x^2$
\task $\dfrac{2}{x+3}-\dfrac{1}{x-7}=1$
\end{tasks}
\end{Exercise}
\end{ExerciseBox}
\end{document}