A two-edged sword can easily cut through a person's flesh. God's word is very effective in showing what is in a person's heart and thoughts. The sword has a blade that is sharp on both edges.
This continues speaking about God's word as if it were a sword. Here the sword is so sharp that it can cut through and divide parts of the human that are very difficult or even impossible to divide. This means that there is nothing inside us that we can hide from God.
These are two different but closely related nonphysical parts of a human. The "soul" is what causes a person to be alive. The "spirit" is the part of a person that causes him to be able to know and believe in God. The "joint" is what holds two bones together. The "marrow" is the center part of the bone.