Exact definition of average time complexity?
Here is the definition of average-case time complexity of an algorithm:

Let $T(x)$ be the running time of some algorithm $A$ on input $x$. For every $n$, let $\mu_n$ be a distribution on inputs of length $n$. The average-case or expected time complexity of $A$ on inputs of length $n$ is $$T_{\mathit{avg}}(n) := \mathbb{E}_{x \sim \mu_n} T(x). $$

As you can see, in order to talk about average-case complexity, you have to specify a distribution. In the definition above I have alluded to the common case in which the complexity is parameterized by input length, but we could also have more parameters, or no parameters at all.
For comparison-based sorting algorithms, we usually consider the following distribution $\mu_n$: the uniform distribution on all $n!$ permutations of $1,\ldots,n$. However, we would obtain exactly the same notion of average-case complexity (for comparison-based algorithms) if instead we pick any atom-less distribution $\mu$, and define $\mu_n$ to consist of $n$ iid copies of $\mu$.
Unfortunately, no distribution on the integers is atom-less. This creates a problem, since if we generate $n$ iid copies of a distribution $\mu$ with atoms, then there is positive probability that the generated elements are not distinct. While comparison-based sorting algorithms can certainly handle this case, the situation becomes much less clean since the average-case time complexity now depends on $\mu$.
Finally, you seem to be quoting a quite informal average-case complexity analysis of quicksort. You can find rigorous analysis of the average-case complexity of quicksort (in fact, two different ones) in lecture notes of Avrim Blum.