This question already has an answer here:
This year I am doing some travelling above what I would normally do. I am planning on a trip to the USA in April for about 30 days. After this I am returning to England for over a month.
Subsequently I will fly to Canada at the end of June, spend about 20 days there, before flying into the USA for 10 days and crossing the border back to Canada. My re-entry to the USA will be after my 90-day limit is up from the original admission. After that I will most likely fly back to England again. Will this be deemed acceptable by the border control, and how will they know I have left and haven't just gone to Canada to try and get around the 90-day stay rule?