Retirement

My husband and I are both retiring in the third quarter of this year. We have to fill out a W4 for our retirement income. How do we know what to put on the form if we want the smallest amount of taxes taken out without having to pay a penalty at tax time? We don't mind paying some taxes when filing, but don't want to pay a penalty.