Please find the below format to create the naming format as per your choice. You shall create the naming formats under Admin Tab > Naming formats.

Support for word and every words.
[U] denotes Upper case
[L] denotes lower case
[I] denotes init caps (First Letter will be in upper case and rest remains same)
[S] denotes fully caps (First letter will be in upper case and the rest in lower case)

char which denote 'word' () 
char which denote 'every word' *() 

Samples,

%sn%2            First 2 char 
%sn%2#          Last 2 char 
%sn%2[U]       First 2 char with upper 
%sn%2#[L]      Last 2 char with lower 
%sn%              Given all char 
%sn%[L]          Given all char with Lower 

%sn%2*()         First 2 char in every word 
%sn%2()          First 2 char in first word 
%sn%2#()#       Last 2 char in last word 
%sn%()            All char in first word 
%sn%()#          All char in last 
%sn%              All char 

%sn%2[U]*()      First 2 char with upper case in every word 
%sn%2[L]*()      First 2 char with lower case in every word 
%sn%2#[U]*()    Last 2 char with upper case in every word 
%sn%2#[L]*()    Last 2 char with lower case in every word 
%sn%[U]()        First word with upper case 
%sn%[L]()#       Last word with lower case

 We gave options for Init caps '[I]', Word '()', Last Word '()#' and Every word '*()'.
 Ex: Consider givenName='fiRSt NAme' and sn='laST nAme'.
       For %givenName%4[I]()%sn%3#() output will be      'FiRSaST'.
       For %givenName%[I]*()%sn%3[U]()#   output will be      'FiRStNAmeLAST'.
       For %givenName%4[S]()%sn%3#() output will be      'FirsaST'.
       For %givenName%[S]*()%sn%3[U]()#   output will be      'FirstNameNAM'.