People with the green dot next to their name are the ones who are actually online, but Facebook also puts the people you interact most with there, even if they're not on. I honestly don't know how you could change that, though, sorry.
Does that help?