Chemistry is a subject where sometimes you need to remember certain things, this is one such case.
While reacting with metals sulphur has a valency of 2 while iron can take any of its valencies(2 or 3) forming compounds.
FeS and Fe2S3
Here you can actually keep in mind the formulae of the compounds(which is pretty easy) or the fact that sulphur has a valency 2 when forming sulphides ie reacting with metals.