I believe you have to be working in Canada, for a Canadian employer, for the hours to count.
As you'll be gone for 2 months, you'll need to include your sister's address in your address history and IRCC will determine you were not working in Canada.
As to the legality, that would be up to the USA.