A Hilbert space is a separable topological space (contains a countable dense subset) if and only if it has a countable orthonormal Hilbert basis. See this question.
Note the difference between a Hilbert basis and a Hamel basis. In a Hamel basis, every vector is a finite linear combination of basis vectors, but in a Hilbert basis, every vector is uniquely expressible as an infinite linear combination of basis vectors, defined as the limit of partial sums. This requires the Hilbert space to have a metric to define limits, so does not apply in an abstract vector space.
For example, if $V=\ell^2(\mathbb{N})$ is the space of functions $f:\mathbb{N}\to\mathbb{R}$ with finite $\ell^2$ norm, modulo functions with vanishing $\ell^2$ norm, equipped with a topology coming from the $\ell^2$ norm, then the characteristic functions of singleton sets (i.e. Kronecker delta functions) form a countable Hilbert basis (not a Hamel basis), and their $\mathbb{Q}$-span (i.e. the finite rational linear combinations of them, which are functions $f:\mathbb{N}\to\mathbb{Q}$ with finite support) is a countable dense subset (isomorphic as an abstract vector space to $\mathbb{Q}^{\oplus\mathbb{N}}$).
Hilbert spaces are complete (i.e. every Cauchy sequence converges) and defined over $\mathbb{R}$ or $\mathbb{C}$, so that automatically bars $\mathbb{R}$ from being a Hilbert space over $\mathbb{Q}$. There are more general notions of topological vector spaces than Hilbert spaces as well (e.g. Banach spaces as in Noah's answer).