How to wire half-switched outlet with two black and two white
It sounds like you're looking to end up with something like this



Notice the white wire that's been repurposed, is marked at both ends with black tape/marker/paint. And that the tab between the top and bottom receptacles, is broken on the "hot" side of the device. Also notice that a pigtail is used, instead of connecting more than one wire to a terminal on the receptacle.

To determine which set of wires goes to the switch...


Turn off the breaker, and make sure power is off.
Set your multimeter or ohmmeter to test continuity or low resistance.
Disconnect all the wires from the switch.
Test between the black and white wire of cable 1.
Test between the black and white wire of cable 2.
Toggle the switch.
Test the wires again


One pair of wires should test positive for continuity, when the switch is in the  on position.  This is the cable going to the switch.

NOTE: This type of installation is no longer code compliant (NEC), because it does not provide a grounded (neutral) conductor at the switch location.

NOTE: Grounding conductors have been omitted from the diagram for simplicity.  Make sure all grounding conductors are properly installed.