How do you use jr in last names

For instance: Richard E. Smith Jr.

Do you write?: Smith, E. Jr, Richard? Or this is wrong?

Thank you.

If his name was Richard E. Smith Jr. and you wanted last names first, you would write Smith, Richard E. Jr.

And when you fill out any form and it asks your last name first, do you write Smith without jr?

Thank you.