As far as is known, Shakespeare never left England at all. As there are some years in his life where nobody is sure what he was doing, it is indeed possible that he may have travelled abroad during those years, but all the poems and plays that we have are dated later - after his arrival in London - and from that point on, we know more or less where he was at any time. So to answer your question: As far as we know, Shakespeare wrote all his works while living in England, though it is possible that he may have travelled abroad before starting to write.
There is, however, a school of thought that suggests Shakespeare may well have fought in the Low Countries against the invasion of Spain, as England desperately needed to keep Antwerp open for free trade on her wool revenues.
There is also the suggestion,slight as it happens, that Shakeaspeare circumnavigated the globe with Drake!
There is also the suggestion,slight as it happens, that Shakeaspeare circumnavigated the globe with Drake!