Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
"Modifies" as in "is attached to". "Only two" implies that he could have stayed there for more than two, but stayed for "only two" instead. If he meant "This was the only place he stayed for two days", then "He stayed here only for two days" would be alright, but "He stayed only here for two days" would be better. Given this, the second option is better if the number of days is what "only" refers to.