Unfortunately there is no formula to solve this problem. Please have a look at
this thread which links to another that tries to explain why there is no solution.
In fact you need at least six rounds before the all-plays-with-all criterion can be met. There is an
example of a schedule here.The best compromise is to play five rounds, in which case there will be 6 pairs of players who never play together in the same foursome. Ignore the example that you can find by following the first link above, instead
use the schedule here, just ignore the doubles layout and turn each court into a foursome - the pairs that never play together are: (1 7), (2 8), (3 9), (4 10), (5 6), (11 12).
Hope that helps.