Article Nonparametric Multivariate Analyses of Changes in Community Structure
The basic answer is that p values are calculated by randomly permuting the labels of the resemblance matrix (with constraints imposed by the experimental design) and recalculating R for each permutation. The observed value is then compared with the permuted values (null distribution) to see if a value of R as high as, or higher than, the observed value from the data might have been likely if the null hypothesis (no difference) were true. If not it may be concluded that the null hypothesis is false. More complicated designs with ordered factors and 2 or 3 factors recently added to https://www.researchgate.net/profile/Paul-Somerfield/research
You can find tables for estimating the p-value of your test statistic online. These tables show, based on the test statistic and degrees of freedom (number of observations minus number of independent variables) of your test, how frequently you would expect to see that test statistic under the null hypothesis