Complex sentence: Joel wrote "Captain Jack" in late 1971, while sitting in his apartment in Oyster Bay, Long Island, looking out the window, trying to find inspiration for a song.
Split into simpler sentences: Joel wrote "Captain Jack" in late 1971. He was sitting in his apartment in Oyster Bay, Long Island, looking out the window, trying to find inspiration for a song.