The mechanism for the conversion of an alcohol to the N-substituted thiocarbamate is shown below. The reaction proceeds under acidic conditions. The alcohol accepts a hydrogen ion from sulfuric acid to form a water, which then leaves, creating a carbocation. The mesomeric form of the cyanogroup reacts with the carbocation. The carbocation is attacked by a water, which then loses an hydrogen to form the product. The product then undergoes hydrolysis to form the N-substituted thiocarbamate. 
The reaction requires the formation of a carbocation and does not work for primary alcohols. Only secondary and tertiary alcohols undergo the Riemschneider reaction.