Be occupied

He was occupied with the latest report at the moment.

 I’m sure that I have chosen the right preposition in the sentence above, but I’m    unsure which preposition should I use in the sentence below:

He was occupied in/with doing his homework.

Please help me…

He was occupied in doing his homework.
He was occupied with his homework.

Many thanks…