How did Congress impeach Andrew Johnson?

Congress never actually impeached Andrew Johnson, but he was accused of a crime that would have had him impeached; the supreme court ruled in his favor.