Below working XML configuration which excludes usually unnecessary applications from installation. I have left only Word, Excel, PowerPoint, OneNote. Excluded Publisher, Outlook, Skype, Access.
<Configuration>
<Add OfficeClientEdition="32" Channel="Monthly" SourcePath="D:\" OfficeMgmtCOM="TRUE">
<Product ID="O365HomePremRetail">
<Language ID="en-us"/>
<ExcludeApp ID="Access" />
<ExcludeApp ID="Outlook" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Lync" />
</Product>
</Add>
<Updates Enabled="TRUE" Channel="Monthly"/>
<Display Level="Full" AcceptEULA="FALSE"/>
</Configuration>
More advanced example
<Configuration ID="8eed70e6-0e8d-4a9e-869a-c3bd86d37f84">
<Add OfficeClientEdition="64" Channel="Monthly" AllowCdnFallback="TRUE">
<Product ID="O365HomePremRetail">
<Language ID="en-us" />
<Language ID="lt-lt" />
<ExcludeApp ID="Access" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
<ExcludeApp ID="OneDrive" />
<ExcludeApp ID="Publisher" />
</Product>
</Add>
<Property Name="SharedComputerLicensing" Value="0" />
<Property Name="FORCEAPPSHUTDOWN" Value="FALSE" />
<Property Name="DeviceBasedLicensing" Value="0" />
<Property Name="SCLCacheOverride" Value="0" />
<Property Name="AUTOACTIVATE" Value="0" />
<Updates Enabled="TRUE" />
<AppSettings>
<User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
<User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
<User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
</AppSettings>
<Display Level="Full" AcceptEULA="TRUE" />
</Configuration>
Command to execute deployment tool with above XML “setup.exe /configure configuration.xml“
References: