"So when Muslims were ruling Spain they did not allow Christians to use this place?"
Of course not.
Rule changed hands in these kingdoms many times. The Spanish people made provision for conversion/reconversion/reconversion ~ whatever the local king was into, that's what they were into as well.
People who didn't go along with that system tended to relocate insofar as that was possible, to either Christian or Moslem kingdoms as appropriate.
There were also two large invasions by Moslems. One was quite early during a period when Spanish population was rather diminished (by the Dark Ages), and a couple of centuries later by some North African Islamic reformers. The Reconquista began when King San Cho Noe I came from Cornwall to establish three new kingdoms in Galicia.