The traditional IRA to Roth IRA is not a rollover but a conversion. That is typically a taxable event. Roth contributions are after-tax whereas traditional IRA contributions are pre-tax. So line 4b should have the distribution amount as taxable. The rollover designation does not apply (even though box 7 may have code G).
However, if you had non-deductible contributions (paid the taxes on the contributions previously) over the years that you have tracked and therefore have basis in the traditional IRA, then you will be asked about that amount in the follow on 1099R pages. When you enter that non-deductible contribution amount it will be non-taxable on line 4a. The difference, if any, from the 1099R box 1 amount will be taxable on line 4b.
For the after tax 401K to Roth 401K, only the amount of contributions to the after-tax 401K that rolled to the Roth 401K are tax free. Any earnings rolled over will be taxable on line 5b. Box 7 of the after-tax 401K distribution 1099R should be G coded indicating a rollover. Box 5 should have your contribution amount and the difference between box 1 and box 5 will be the taxable amount in box 2a which should show up on line 5b of your form 1040.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"