What is the condition for the number density of a gas to be ultra-relativistic or non-relativistic and degenerate or ideal What is the condition for the number density ($n$) of a gas to be ultra-relativistic or non-relativistic and degenerate or ideal?

I found problems in this subject when I was reading about White-Dwarfs. 

A book said $n \gg n_{QUR}$ or $n \ll n_{QUR}$ is the condition for being degenerate or ideal (classical), respectively. And $n_{QUR} = 8 \pi (kT/hc)^3$. Is this condition right? I know where $n_{QUR}$ comes from but I don't know what it really shows.

In that book it is said that $n \ll (mc/h)^3$ is the condition for being ultra-relativistic for a degenerate gas and $kT\gg mc^2$ is the condition for being ultra-relativistic for an ideal gas. Where do these equations come from? What is $mc/h$ ?

In another way, my question is mainly about this diagram and about how we can get the lines in this diagram. 

Credit: The Physics of Stars, A.C.Phillips




$k$ Boltzmann constant
$h$ Planck constant
$c$ light speed
$n$ is number density, not the number of particles
$n_{QUR}$ is the quantum concentration number for ultra-relativistic particles
This is fairly standard bookwork that I am not going to reproduce and you should understand that the lines on your diagram are "fuzzy" in the sense that they mark the loci where you can neither use one approximation or another.

So first, the division between a classical gas and a quantum gas (note that all the gases in your plot are ideal - the term ideal refers to the particles being point-like and non-interacting, which is as true for the electrons in a white dwarf as those in the atmosphere of the Sun). The condition here is that for a classical gas, the density/temperature combination should be such that the phase-space (3d momentum $\times$ volume) occupied by each particle is much greater than $\hbar^3$. This ensures that there are more available quantum states than indistinguishable electrons to fill them.

The second criterion is to compare the momentum of particles with $mc$. Clearly if these are comparable then the particles are relativistic. In a classical gas, the momentum depends on the square root of temperature, as you quote. In a Fermi-Dirac quantum gas, the maximum momentum only depends on the density of particles (as $n^{1/3}$). Hence the differing criteria.