I understand the verbal meaning and graphical interpretation of homoscedasticity is that the variance of error term is same for any value of x, or in other words, the data points spread evenly between the regression line for any value of x. The non-matrix form is $\newcommand{\Var}{{\rm Var}}\Var(Ui|xi)=\theta^2$, for which, I can also understand.
But, I don't understand its Matrix expression: $\Var(U|X)=\theta^2I$. Especially expanding $\Var(U|X)$, we have
$$\Var(U|X)=E\begin{bmatrix}u1^2 &u1*u2 &...\\ u2*u1 &u2*u2 &...\\....\end{bmatrix}$$
I don't know whether the $u1, u2, ...$ here are error terms or residuals, and whether they are treat as random vectors or fixed values. If they are error terms, how can we test homoscedasticity (given they are unobservables. We test homoscedasticity on residuals right? based on the scatterplot of data points and regression line)? If they are residuals, $u1, u2, ...$ should be a fixed variable right? How come we can talk about expectations and variances?