The question can be interpreted to be asking how X-bar theory prevents nonsensical phrases such as the really house, running the, and every inside. The answer is that no aspect of X-bar theory prevents such phrases from being generated. The X-bar schema merely provides the scaffold for phrases. It is a rough schematic outline that all phrases supposedly conform to.
What blocks such nonsensical phrases from being generated is the combinatory potential of the lexical items involved, i.e. of the words. The combinatory potential of words is often explored in terms of subcategorization and/or valency. subcategorization and valency traits dictate how lexical items can combine with each other. These characteristics exist independently of the X-bar schema. The X-bar schema takes these traits for granted.
The valency traits of the adverb really require that it take a verb as its head. The valency traits of the quantifier every require that it take a noun as its dependent (on a DP analysis of noun phrases). The valency traits of the preposition inside require that it take a verb or a noun as its head and a nominal as its dependent. These valency requirements prevent the X-bar schema from overgenerating.
Worth noting is the fact that X-bar schema was largely abandoned by much of Chomskyan syntax in the mid 1990s, so-called bare phrase structure (BPS) taking its place. The MP (Minimalist Program) does not assume the X-bar schema. Ray Jackendoff, who produced the seminal book X-bar Syntax (1977) abandoned the X-bar schema decades ago. He now advocates much simpler syntactic structures than those associated with X-bar theory - see his book with Peter Culicover Simpler Syntax (2005). Many other approaches to syntax (e.g. Head-Driven Phrase Structure Grammar, Construction Grammar, Tree-Adjoinig Grammar, Word Grammar, Meaning-Text Theory) never assumed the X-bar schema.
Thus if there is skepticism about the X-bar schema and its potential to provide a universal basis for exploring the syntactic structure of natural languages, this skepticism finds much company among many grammarians.