  A search for heavy right-handed Majorana or Dirac neutrinos $N_R$ and heavy
right-handed gauge bosons $W_R$ is performed in events with a pair of energetic
electrons or muons, with the same or opposite electric charge, and two
energetic jets. The events are selected from $pp$ collision data with an
integrated luminosity of 36.1 fb$^{-1}$ collected by the ATLAS detector at
$\sqrt{s}$ = 13 TeV. No significant deviations from the Standard Model are
observed. The results are interpreted within the theoretical framework of a
left-right symmetric model and lower limits are set on masses in the heavy
right-handed $W$ boson and neutrino mass plane. The excluded region extends to
$m_{W_R}=4.7$ TeV for both Majorana and Dirac $N_R$ neutrinos.
