[Fake projective planes][1] have $H_2(X,\mathbb{Z}) \cong \mathbb{Z}$. They have metrics of pinched negative curvature, so they have $\pi_2(X) \cong \{0\}$. Thus $H_2(X,\mathbb{Q}) \cong \mathbb{Q}$ is generated by a hyperplane section, and this is not a rational curve. A Picard maximal fake quadric (a surface of general type with the same rational cohomology as $\mathbb{P}^1 \times \mathbb{P}^1$) with universal cover the product of two hyperbolic planes will also have the desired property with $H_2(X,\mathbb{Q}) \cong \mathbb{Q}^2$. They have metrics of nonpositive curvature, so again $\pi_2$ is trivial. For example, there are "product quotient" examples; see The classification of surfaces with pg=q=0 isogenous to a product of curves, Pure Appl. Math. Q. 4 (2008), no. 2, Special Issue: In honor of Fedor Bogomolov. Part 1, 547–586 by Bauer, Catanese, and Grunewald. You should also look into other surfaces with $p_g = q = 0$. You certainly want $p_g = 0$, and so $q = 0$ if the surface is minimal of general type (you certainly want minimal for $\pi_2(X)$ to be $\{0\}$). For example, see Bauer, Catanese, and Pignatelli's Surfaces of general type with geometric genus zero: a survey, Complex and differential geometry, 1-48, Springer Proc. Math., 8, Springer, Heidelberg, 2011. [1]: https://en.wikipedia.org/wiki/Fake_projective_plane