The OP clearly stated "I know it's the rear as if I change gear at the front, the timing doesn't change." That means that any idea that does not correspond to rear wheel rotation is invalid. That includes any part of the crank/BB assembly or the chain.