Did he knew about the Michelson-Morley experiment?
He just knew the name of the experiment not any details. The experiment didn't play any role in the formulation of STR by Albert Einstein.
The context is taken from the book:
Special Theory of Relativity
by V. A.; Atanov, Yuri (Trans.) Ugarov (Author)
Art: Was Michelson's experiment "decisive" for the creation οΙ
the special theory οΙ relativity?
An article by R. Shankland,
published in 1963, the following excerpt from his interview with
Einstein dating back to 1950:
"When Ι asked him how he had learned of the Michelson Morley experiment, he told me that he had become aware of it through
writings of Η. Α. Lοrentz, but only after 1905 had it come to his
attention! "Otherwise" he said, "I would have mentioned it in my
paper!" indeed, Einstein's 1905 paper contains no mention of Μichelson's experiment or references to Lorentz's papers."
A letter written by Albert Einstein:
"Ιn my own development Michelson's result had not had a considerable influence. Ι even do not remember if Ι knew of it at all when I wrote my first paper on the subject (1905). Τhe explanation is that Ι was, for general reasons, firmly convinced how this could be reconciled with our knowledge οf electro-dynamics. One can therefore understand why in my personal struggle Michelson's
experiment played no role or at least no decisive role..."
Best Answer
As far as I know, the only clue at the time that the speed of light would be invariant were Maxwell's Equations where "something" shows up as a constant. However, speed of light being invariant in all inertial reference frames is very counter-intuitive. One might rather expect physics to be slightly different in different frames, which is what the MM experiment was looking for.