I stand corrected! I had never heard the term "by twos and threes" but agree that Matching Mole is absolutely right. I did a swift Google and came up with another example, again British, dating back to 1914:They do mean the same, and can say either, but I would say that "in twos and threes" is more common. Perhaps "by twos and threes" is more old-fashioned. Here is an authentic example from 1906 (British):
"Robin and his men went back as they had come, by twos and threes"
[Stories of Robin Hood Told to the Children, by H. E. Marshall]