2000 mazda protege

I put a used but running motor in my car and now the timing is wrong.gas fumes are comming out the exhaust and the plugs seem to fire ok but not right because the engine won’t start.