What is an algebraic variety?

Each one of these definitions is morally just a restricted version of each of the more general definitions. To be precise, there are fully faithful functors from the less general definitions to the more general definitions which in some cases are equivalences of categories. Let's rewrite the definitions here so we have a quick reference. We'll cover the affine case first and then explain how to patch everything together to the global case afterwards.

"Classical" definition (affine case): A $k$-variety is an irreducible Zariski-closed subset of $k^n$ for an algebraically closed field $k$ and some integer $n$.

Milne's definition (affine $k$-variety): An affine $k$-variety is a locally ringed space isomorphic to $(V,\mathcal{O}_V)$ where $V\subset k^n$ is a "classical" $k$-variety and $\mathcal{O}_V$ is the sheaf of regular functions on $V$.

Liu's definition: An affine $k$-variety is the affine scheme $\operatorname{Spec} A$ associated to a finitely generated reduced $k$-algebra $A$.

General definition: An affine $k$-variety is $\operatorname{Spec} A$ for a finitely generated $k$-algebra $A$.

Basically what's going on here is that each of these definitions is slowly, grudgingly accepting greater generality and more extensible structure on the road to the general definition.

Milne's definition adds the structure sheaf, but is not yet all the way to a scheme - it's missing generic points. This in particular shows that generally $(V,\mathcal{O}_V)$ is not the spectrum of a ring. (Milne's definition is set up in such a way that there's only one way to get the structure sheaf, so there's an equivalence of categories between the "classical" category and Milne's category.)

From here, Liu's definition adds the generic points - there is a fully faithful functor between Milne's definition and Liu's definition, which has image exactly the irreducible varieties in Liu's definition.

The road from Liu's definition to the general definition is easy: we stop requiring reducedness, which is a technical advantage for some more advanced properties one may wish to consider later on (eg those involving cohomology).

The proof that there are fully faithful functors between all these definitions can be found (among other places) in Hartshorne II.2.6:

Proposition (Hartshorne II.2.6): Let $k$ be an algebraically closed field. There is a natural fully faithful functor $t:\mathfrak{Var}(k)\to \mathfrak{Sch}(k)$ from the category of varieties over $k$ to schemes over $k$. For any variety $V$, it's topological space is homeomorphic to the closed points of the underlying topological space of $t(V)$, and it's sheaf of regular functions is obtained by restricting the structure sheaf of $t(V)$ via this homeomorphism.

The idea of the proof is that one can add the generic points of each irreducible positive-dimensional closed subset and then construct the structure sheaf on this new space in a canonical way, which produces for you a scheme verifying the properties claimed. (In case you're wondering about Hartshorne's definition, Hartshorne defines his category of varieties as quasiprojective integral varieties, of which the affine varieties of the "classical" and Milne's definitions are full subcategories. This same idea of the proof works in all cases.)

This provides us the answer to the first part of your main question: there are fully faithful functors which lets you consider each category as a part of the next more general category. This means that you can generalize without fear.


Now we can talk about gluing and non-affine varieties. In full generality, just like a manifold is some space locally modeled on $\Bbb R^n$, we should have that varieties are locally modeled on affine varieties (and schemes are locally modeled on affine schemes). This is what Milne's getting at with his definition of a prevariety, and what Liu is getting at with the finite cover condition.

There are some pathologies one may wish to avoid, like the line with two origins, which one can get by gluing to copies of $\Bbb A^1$ along the open sets which are the complements of the origin in each copy. Such varieties are non-separated, and that's what the separated condition in Milne's "algebraic $k$-varieties" excludes.

The most general definition one normally sees of a variety over a field is the following:

Most general definition: A $k$-variety is a scheme of finite type over the field $k$.

This allows non-reduced, non-irreducible, non-separated schemes, but keeps the essential finiteness condition of "finite type", which implies that any $k$-variety has a finite cover by affine open $k$-varieties, which is exactly the finiteness condition that Liu and Milne both require. Be warned that many modern authors of papers will take this general definition plus some adjectives, and are not always clear on which adjectives they take. (If you're writing papers in algebraic geometry, please include a sentence in your conventions section which makes it clear what adjectives you take when you write "variety"!)

In this most general situation, affineness and projectiveness are easy to describe. Each is exactly the condition that our variety admits a closed embedding in to $\Bbb A^n_k$ or $\Bbb P^n_k$, respectively, for some $n$. (To connect this with the affine definition as $\operatorname{Spec} A$ of a finitely-generated $k$-algebra, note that we can choose a surjection $k[x_1,\cdots,x_n]\to A$, which gives us $A\cong k[x_1,\cdots,x_n]/I$ for some ideal $I$, and this exactly shows us that $\operatorname{Spec} A \to \operatorname{Spec} k[x_1,\cdots,x_n]=\Bbb A^n_k$ is a closed immersion.)


Let me give a brief clarification, in order to avoid misunderstandings :

1) The elementary approach pioneered in Serre's FAC and described in Milne only works if the base field $k$ is algebraically closed and it completely breaks down if $k$ is not algebraically closed.
One of the main advantages of Grothendieck's scheme approach is that it allows us to speak reasonably of the subscheme $x^2+y^2+1=0$ of $\mathbb A^2_\mathbb Q$ which is infinite, although of course the set of points in $\mathbb Q^2$ satisfying that equation is empty.
The elementary approach cannot handle this situation.

2) Given a reduced finitely generated $k$-algebra $A$, the elementary approach consists in replacing $X=\operatorname {Spec}A$ by the restriction $(V,\mathcal O_V)$ of $X$ to the subspace $V=\operatorname {Specmax}A$ of maximal primes of $A$, and endowing that space with the restriction of the structural sheaf of $X$: $\mathcal O_V=\mathcal O_X\vert V$.
Of course $V$ is very different from $X$: all its points are closed and in particular $V$ has no generic point.
However one still has $\mathcal O_V(V)=\mathcal O_X(X)=A$ and all the information contained in $X$ is saved in $(V,\mathcal O_V)$.
This assertion is translated technically into the theorem that the map $X\mapsto V$ is an equivalence of categories.
Its quasi-inverse is a bit more difficult to explain: the description is in Hartshorne's Proposition II.6 .