A line in R^3 can be described by a parametric equation of the form
\textbf{r}(t) = \textbf{r}_0+t\textbf{v},
where \textbf{r}_0 is the position vector representing a point in \mathbb{R}^3, t is a real number, and \textbf{v} is a non-zero displacement vector indicating the direction of the line (and also its orientation: which way along the line is positive).
The condition for this line to be parallel to the xy-plane is that the z-component of \textbf{v} is zero. That is, \textbf{v} must be of the form (v1,v2,0), where v1 and v2 are fixed real numbers, not both 0. Suppose this is the case. If, and only if, v1 is 0, the line will be parallel to the y-axis. If, and only if, v2 is 0, the line will be parallel to the x-axis.