Hi,
I have a B1/B2 visa valid for five years and earlier this year entered the USA on a B1 for 3 months. I left correctly before the date on my I-94 (after 2.5 months) and flew to Canada. I've been in Canada just over a month and will be here for another five weeks before returning to my home country.
I went to visit New York for a long weekend to do some sightseeing but was told at the border that right now I was an overstay. I was told that I'm only allowed 90 days and leaving the USA to Canada does not stop that time running. The guard seemed to assume that I was trying to leapfrog back and forth over the border. He was quite threatening and told me that if I tried to get back into the USA again before returning back to my home country first I would be deported and not allowed back in for 10 years. I had no idea what an overstay was at the time but since doing a little research online what he is telling me seems extreme.
However, he gave me entry for five days on the I-94 and I was told that I was fine to enter again for the five days which I did and again left correctly before the date the I-94 expired. After the first guard, another took me aside and had a quick look through my backpack and asked a couple of questions but it was pretty straightforward and he didn't seem to be too worried about me at all.
I had originally booked my flight home from LA and was going to fly there a few days or a week early, again just to do a little sightseeing, which no longer seems like a good idea. However, I'm wondering if I am likely to have any problems entering the USA to transit only if I just fly into LA the same day as my flight out (which is already booked).
Also, should I expect to have any problems getting a visa or entering the USA at a future date? Will I be eligible for the Visa Waiver program in future?
I'm confused about my status and whether I am actually an overstay. If so, why was I allowed entry? I have exited the USA both times by the date on my I-94.
Thanks!

