“Yes … The big [favor] was, I asked if R2 could come with Rey, and if BB-8 could stay behind with the Resistance,” Johnson says. “Originally it was BB-8 who went with Rey, which makes sense for the story in a way. But I asked, ‘Can you do me this solid and switch the droids?’”He also revealed the central point of the movie:
“Figuring out where his head was at was the very first thing I had to do when writing the movie. I had to crack this. And it had to be something for me that first and foremost made sense. Why did Luke Skywalker go off to this island?” Johnson says. “That was the starting point, and that’s what the entire movie explores.”So while light on details it is interesting that Johnson's story relied on making sure R2 was with Luke. Makes since if considering the previous films where R2 is (almost) always with a Skywalker. It also neatly returns BB-8 back to his original owner Poe Dameron.