If the two planets are rigid and spherically symmetric, the gravitational force between them is the same as if both masses were concentrated at their centres of mass. See the Shell Theorem. The strength and direction of this force does not change if the planets are rotated, because they are spherically symmetric. Therefore the attractive force between them does not depend on their spin, only the distance between them. Their spins have no effect on their motion.
If the planets are rigid but not spherically symmetric the force between them will vary as they are rotated. For example, if the planets are spherical but with an additional mass located at one point on the equator, then the attraction between these two extra masses will be strongest when they are closest; this attractive force tends to synchronise the spins of the planets, increasing the rotational speed of the slower while decreasing that of the faster.
Supposing that the planets orbit their overall centre of mass, the orbital and spin angular momenta will interact, while total angular momentum remains the same. The result is that after many rotations they orbit with the extra masses facing each other - a situation called tidal locking.
The same situation will arise if the planets are spherically symmetric but not perfectly rigid. The gravitational force on a planet is greatest closest to the other planet, and the resulting tidal force will cause a non-rigid planet to bulge towards the other. The movement of the bulge through the planetary material causes an overall loss of rotational energy, while also transferring angular momentum between the planets, slowing one planet while spinning up the other. See Tidal locking of a planet to a satellite.
Except in the case in which both planets are spherically symmetric, the force between them and their motion will be further complicated if the spin axes are not parallel and/or not perpendicular to the plane in which they orbit each other, or if the extra mass is not located symmetrically about this plane.