Hi, Jss, welcome to the English Forums! It's "him"; "by" is a preposition and can't take the subject form of the pronoun. Could be "by himself" though...
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.