So we had the following statment in the lecture:

I just dont get why this equation is true, even though it probably just follows immediately from the universal property of the pullback. Thanks in advance!
Edit: So i have thought a little bit more about it and came up with the following: Maps from Spec(R) into the pullback are the same as Maps into X and Y so that the associated diagram commutes. The maps of the latter pullback are ( i think ) just composition with the maps of the Pullback of X and S over Y. Am i going in the right direction?
Remember that limits commute on the second argument of hom (https://ncatlab.org/nlab/show/hom-functor+preserves+limits). Hence, for a scheme $Z$,
$$ \operatorname{Hom} (Z, X \times_S Y) = \operatorname{Hom} (Z, X) \times_{\operatorname{Hom} (Z,S)} \operatorname{Hom} (Z,Y)$$
Which is the desired property of the functor of points.